Skip to content

Commit 83708df

Browse files
authored
use release publisher file to release dev tag too (#311)
use release publisher file to release dev tag
1 parent f207df1 commit 83708df

File tree

2 files changed

+27
-24
lines changed

2 files changed

+27
-24
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,6 @@ jobs:
4343
min-node-version: 18
4444
skip: 'linux-arm,linux-ia32' # skip building for these platforms
4545

46-
dev_publish:
47-
needs: build
48-
runs-on: ubuntu-latest
49-
if: github.ref == 'refs/heads/main'
50-
environment: npm
51-
permissions:
52-
id-token: write # Required for OIDC
53-
contents: read
54-
steps:
55-
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
56-
- uses: actions/download-artifact@v4
57-
- uses: actions/setup-node@v3
58-
with:
59-
node-version: '24'
60-
registry-url: 'https://registry.npmjs.org'
61-
- run: npm install
62-
- id: pkg
63-
run: |
64-
content=`cat ./package.json | tr '\n' ' '`
65-
echo "json=$content" >> $GITHUB_OUTPUT
66-
- run: npm version --no-git-tag-version ${{ fromJson(steps.pkg.outputs.json).version }}-$(git rev-parse --short HEAD)+${{ github.run_id }}.${{ github.run_attempt }}
67-
- run: npm publish --tag dev
68-
6946
build-successful:
7047
if: always()
7148
needs: [build]

.github/workflows/release.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Release
33
on:
44
push:
55
branches:
6+
- main
67
- v[0-9]+.x
78

89
jobs:
@@ -15,9 +16,11 @@ jobs:
1516
min-node-version: 18
1617
skip: 'linux-arm,linux-ia32' # skip building for these platforms
1718

18-
publish:
19+
publish_release:
1920
needs: build
2021
runs-on: ubuntu-latest
22+
# release.yml also runs on main for dev publishes, so keep release publishes on version branches only.
23+
if: startsWith(github.ref, 'refs/heads/v')
2124
environment: npm
2225
permissions:
2326
id-token: write # Required for OIDC
@@ -43,3 +46,26 @@ jobs:
4346
- run: |
4447
git tag v${{ fromJson(steps.pkg.outputs.json).version }}
4548
git push https://x-access-token:${{ steps.octo-sts.outputs.token }}@github.com/${{ github.repository }}.git v${{ fromJson(steps.pkg.outputs.json).version }}
49+
50+
publish_dev:
51+
needs: build
52+
runs-on: ubuntu-latest
53+
if: github.ref == 'refs/heads/main'
54+
environment: npm
55+
permissions:
56+
id-token: write # Required for OIDC
57+
contents: read
58+
steps:
59+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
60+
- uses: actions/download-artifact@v4
61+
- uses: actions/setup-node@v3
62+
with:
63+
node-version: '24'
64+
registry-url: 'https://registry.npmjs.org'
65+
- run: npm install
66+
- id: pkg
67+
run: |
68+
content=`cat ./package.json | tr '\n' ' '`
69+
echo "json=$content" >> $GITHUB_OUTPUT
70+
- run: npm version --no-git-tag-version ${{ fromJson(steps.pkg.outputs.json).version }}-$(git rev-parse --short HEAD)+${{ github.run_id }}.${{ github.run_attempt }}
71+
- run: npm publish --tag dev

0 commit comments

Comments
 (0)