Skip to content

Commit 5dabde4

Browse files
authored
chore: restore gh action files (#897)
1 parent 637f4ff commit 5dabde4

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

.github/workflows/promote.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: promote
2+
on:
3+
push:
4+
# Sequence of patterns matched against refs/tags
5+
tags:
6+
- v6.*
7+
jobs:
8+
build-and-promote:
9+
runs-on: ubuntu-latest
10+
env:
11+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
13+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Build for promotion
17+
run: yarn install --frozen-lockfile && yarn build
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '20.x'
21+
registry-url: 'https://registry.npmjs.org'
22+
- name: GitHub Tag Name example
23+
run: |
24+
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME"
25+
echo "Tag name from github.ref_name: ${{ github.ref_name }}"
26+
- name: Manual publish
27+
run: |
28+
cd packages/module
29+
npm version ${{ github.ref_name }} --git-tag-version false
30+
npm publish --tag=latest

.github/workflows/release.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- v5
7+
jobs:
8+
call-build-lint-test-workflow:
9+
uses: ./.github/workflows/build-lint-test.yml
10+
deploy:
11+
runs-on: ubuntu-latest
12+
needs: [call-build-lint-test-workflow]
13+
env:
14+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
15+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
- uses: actions/cache@v4
22+
id: npm-cache
23+
name: Cache npm deps
24+
with:
25+
path: |
26+
node_modules
27+
**/node_modules
28+
~/.cache/Cypress
29+
key: ${{ runner.os }}-yarn-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('package-lock.json') }}
30+
- run: npm install --frozen-lockfile
31+
if: steps.npm-cache.outputs.cache-hit != 'true'
32+
- uses: actions/cache@v4
33+
id: dist
34+
name: Cache dist
35+
with:
36+
path: |
37+
packages/*/dist
38+
packages/react-styles/css
39+
key: ${{ runner.os }}-dist-14-${{ secrets.CACHE_VERSION }}-${{ hashFiles('package-lock.json', 'package.json', 'packages/*/*', '!packages/*/dist', '!packages/*/node_modules') }}
40+
- name: Build dist
41+
run: npm run build
42+
if: steps.dist.outputs.cache-hit != 'true'
43+
- name: Release to NPM
44+
run: cd packages/module && npx semantic-release@19.0.5

0 commit comments

Comments
 (0)