-
Notifications
You must be signed in to change notification settings - Fork 330
45 lines (40 loc) · 1.31 KB
/
publish.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 release
on:
push:
branches:
- "releases/**"
permissions:
contents: write
jobs:
tag-and-publish-to-npm:
runs-on: ubuntu-latest
if: "startsWith(github.event.head_commit.message, 'release: ')"
steps:
- uses: actions/[email protected]
- name: Extract version
shell: bash
run: echo "TAG_NAME=$(git log -1 --oneline --pretty=%B | sed 's/release:\ //g')" >> $GITHUB_ENV
- name: Tag commit
uses: tvdias/[email protected]
with:
repo-token: "${{ secrets.GH_TOKEN }}"
tag: ${{ env.TAG_NAME }}
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: yarn
- name: Publish all packages
run: ./scripts/publish.sh latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# Trigger a new build to ensure Vercel creates a distinct release branch, rather than reusing latest
- name: Triggering new build
run: |
git config --global user.name 'chrisvxd'
git config --global user.email '[email protected]'
git commit -m "ci: trigger build" --allow-empty
git push
timeout-minutes: 10