Skip to content

Commit ca52081

Browse files
committed
ci: fix tagging deployment
1 parent f1aad8f commit ca52081

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

.github/workflows/ci.yml

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,37 @@ jobs:
9595
name: cobertura-coverage
9696
path: tmp/coverage/cobertura-coverage.json
9797

98+
build-prerelease:
99+
name: "Build / Pre-release"
100+
runs-on: ubuntu-latest
101+
needs:
102+
- check-lint
103+
- check-build
104+
- check-test
105+
if: >
106+
startsWith(github.ref, 'refs/tags/v') &&
107+
contains(github.ref, '-')
108+
steps:
109+
- uses: actions/checkout@v4
110+
- name: Run deployment
111+
run: |
112+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
113+
echo 'Publishing library prerelease'
114+
npm install
115+
npm publish --tag prerelease --access public
116+
rm -f ./.npmrc
117+
98118
build-pull:
99119
name: "Build / Pull Request"
100120
runs-on: ubuntu-latest
101121
needs:
102122
- check-lint
103123
- check-build
104124
- check-test
105-
if: github.ref == 'refs/heads/staging'
125+
if: >
126+
github.ref == 'refs/heads/staging' ||
127+
(startsWith(github.ref, 'refs/tags/v') &&
128+
!contains(github.ref, '-'))
106129
steps:
107130
- uses: actions/checkout@v4
108131
- name: Create pull request
@@ -121,34 +144,17 @@ jobs:
121144
--body-file - \
122145
--repo "$GITHUB_REPOSITORY"
123146
124-
build-prerelease:
125-
name: "Build / Pre-release"
126-
runs-on: ubuntu-latest
127-
needs:
128-
- check-lint
129-
- check-build
130-
- check-test
131-
if: >
132-
startsWith(github.ref, 'refs/tags/v') &&
133-
contains(github.ref, '-')
134-
steps:
135-
- uses: actions/checkout@v4
136-
- name: Run deployment
137-
run: |
138-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ./.npmrc
139-
echo 'Publishing library prerelease'
140-
npm install
141-
npm publish --tag prerelease --access public
142-
rm -f ./.npmrc
143-
144147
integration-merge:
145148
name: "Integration / Merge"
146149
runs-on: ubuntu-latest
147150
concurrency:
148151
group: integration-merge
149152
cancel-in-progress: true
150153
needs: build-pull
151-
if: github.ref == 'refs/heads/staging'
154+
if: >
155+
github.ref == 'refs/heads/staging' ||
156+
(startsWith(github.ref, 'refs/tags/v') &&
157+
!contains(github.ref, '-'))
152158
steps:
153159
- uses: actions/checkout@v4
154160
with:

0 commit comments

Comments
 (0)