Skip to content

Commit 0703dfd

Browse files
authored
Merge pull request #1819 from nextcloud-libraries/release/v2.0.0-rc.0
chore(release): v2.0.0-rc.0
2 parents e386555 + 4d4cac2 commit 0703dfd

File tree

4 files changed

+34
-25
lines changed

4 files changed

+34
-25
lines changed

.github/workflows/npm-publish.yml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This workflow is provided via the organization template repository
22
#
3-
# https://github.com/nextcloud/.github
3+
# https://github.com/nextcloud-libraries/.github
44
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
55
#
66
# SPDX-FileCopyrightText: 2021-2024 Nextcloud GmbH and Nextcloud contributors
@@ -14,40 +14,34 @@ on:
1414

1515
permissions:
1616
contents: read
17+
packages: write
1718

1819
jobs:
1920
publish:
2021
runs-on: ubuntu-latest
21-
2222
name: Build and publish to npm
23-
permissions:
24-
packages: write
2523

2624
steps:
27-
- name: Check actor permission level
28-
uses: skjnldsv/check-actor-permission@69e92a3c4711150929bca9fcf34448c5bf5526e7 # v3.0
29-
with:
30-
require: write
31-
3225
- name: Checkout
3326
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3427
with:
3528
persist-credentials: false
3629

37-
- name: Read package.json node and npm engines version
38-
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
39-
id: versions
40-
with:
41-
fallbackNode: '^20'
42-
fallbackNpm: '^10'
43-
44-
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
30+
- name: Set up node
4531
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4632
with:
47-
node-version: ${{ steps.versions.outputs.nodeVersion }}
33+
node-version-file: 'package.json'
4834

49-
- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
50-
run: npm i -g 'npm@${{ steps.versions.outputs.npmVersion }}'
35+
- name: Check tag matches package.json
36+
run: |
37+
VERSION=$(node -p -e "require('./package.json').version")
38+
GH_VERSION=$(echo "$GH_VERSION" | sed s,\^v,,)
39+
if [ "$VERSION" != "$GH_VERSION" ]; then
40+
echo "$VERSION does not match $GH_VERSION"
41+
exit 1;
42+
fi;
43+
env:
44+
GH_VERSION: ${{ github.event.release.tag_name }}
5145

5246
- name: Install dependencies & build
5347
env:
@@ -56,9 +50,24 @@ jobs:
5650
npm ci
5751
npm run build --if-present
5852
53+
- name: Fetch latest tag
54+
id: latest-tag
55+
run: |
56+
TAG=$(gh release list \
57+
--exclude-drafts \
58+
--exclude-pre-releases \
59+
--json isLatest,tagName \
60+
--jq 'map(select(.isLatest == true))[].tagName' \
61+
-R ${{ github.repository }})
62+
echo "Latest tag is $TAG"
63+
echo "LATEST_TAG=$TAG" >> $GITHUB_OUTPUT
64+
env:
65+
GH_TOKEN: ${{ github.token }}
66+
5967
- name: Publish
6068
run: |
6169
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
62-
npm publish
70+
npm publish --tag $RELEASE_GROUP
6371
env:
6472
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
73+
RELEASE_GROUP: ${{ (contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha')) && 'next' || ((steps.latest-tag.outputs.LATEST_TAG != github.event.release.tag_name) && 'stable' || 'latest') }}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
-->
55
# Changelog
66

7-
## [v2.0.0-rc.0](https://github.com/nextcloud-libraries/nextcloud-upload/tree/next) \(UNRELEASED\)
7+
## [v2.0.0-rc.0](https://github.com/nextcloud-libraries/nextcloud-upload/tree/v2.0.0-rc.0) \(2025-07-01\)
88

99
### 💥 BREAKING CHANGES
1010

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nextcloud/upload",
3-
"version": "1.10.0",
3+
"version": "2.0.0-rc.0",
44
"description": "Nextcloud file upload client",
55
"keywords": [
66
"nextcloud",

0 commit comments

Comments
 (0)