-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (43 loc) · 1.33 KB
/
publish-packages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Publish packages with updated changelog to npmjs.org
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.TAGS }}
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.MAIN_BOT_KEY_PRIVATE }}
- uses: actions/setup-node@v4
with:
node-version: 20.16.0
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: |
RETURN_TAGS=$(node ./scripts/versionPackages)
echo "TAGS=$RETURN_TAGS" >> $GITHUB_ENV
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: EndBug/add-and-commit@v9
with:
author_name: Dataport Geo Bot
author_email: [email protected]
- run: |
for TAG in ${{ env.TAGS }}
do
git config user.name "Dataport Geo Bot"
git config user.email "[email protected]"
git tag $TAG
git push origin $TAG
echo "Released and tagged $TAG"
done
- run: node ./scripts/publishPackages ${{ env.TAGS }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: node ./scripts/createRelease ${{ env.TAGS }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}