Skip to content

Commit ff06cb4

Browse files
committed
chore(github-actions): remove semantic release to actions
1 parent c387d3c commit ff06cb4

File tree

1 file changed

+23
-29
lines changed

1 file changed

+23
-29
lines changed

.github/workflows/npm-publish.yml

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
name: CI/CD Pipeline
1+
name: "@smakss/react-scroll-direction"
22

33
on:
4-
push:
5-
branches:
6-
- master
4+
release:
5+
types: [created]
76

87
jobs:
98
build:
@@ -22,29 +21,8 @@ jobs:
2221
./path-to-your-build-folder
2322
package.json
2423
25-
release:
26-
needs: build
27-
runs-on: ubuntu-latest
28-
permissions:
29-
contents: write
30-
issues: write
31-
pull-requests: write
32-
id-token: write
33-
steps:
34-
- uses: actions/checkout@v3
35-
- uses: actions/setup-node@v3
36-
with:
37-
node-version: 'lts/*'
38-
registry-url: https://registry.npmjs.org/
39-
- run: yarn install
40-
- name: Semantic Release
41-
env:
42-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
44-
run: npx semantic-release
45-
4624
publish-npm:
47-
needs: release
25+
needs: build
4826
runs-on: ubuntu-latest
4927
steps:
5028
- uses: actions/checkout@v3
@@ -57,12 +35,20 @@ jobs:
5735
registry-url: https://registry.npmjs.org/
5836
scope: "@smakss"
5937
- run: yarn install
60-
- run: npm publish
38+
- run: yarn generate
39+
- run: |
40+
if grep -q "beta" package.json; then
41+
echo "Publishing Beta to npm"
42+
npm publish --tag beta
43+
else
44+
echo "Publishing Release to npm"
45+
npm publish
46+
fi
6147
env:
6248
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
6349
6450
publish-gpr:
65-
needs: release
51+
needs: build
6652
runs-on: ubuntu-latest
6753
steps:
6854
- uses: actions/checkout@v3
@@ -75,6 +61,14 @@ jobs:
7561
registry-url: https://npm.pkg.github.com/
7662
scope: "@smakss"
7763
- run: yarn install
78-
- run: npm publish
64+
- run: yarn generate
65+
- run: |
66+
if grep -q "beta" package.json; then
67+
echo "Publishing Beta to GitHub Package Registry"
68+
npm publish --tag beta
69+
else
70+
echo "Publishing Release to GitHub Package Registry"
71+
npm publish
72+
fi
7973
env:
8074
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)