-
-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (39 loc) · 1.26 KB
/
release.yml
File metadata and controls
49 lines (39 loc) · 1.26 KB
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
46
47
48
49
name: Release
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: write # required for pushing + uploading release assets
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up Git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
- name: Setup pnpm
uses: pnpm/action-setup@v5
with:
version: 10.33.2
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
- name: Commit build artifacts
run: |
git add dist -f
git commit -m "chore: add build artifacts for release ${{ github.ref_name }}" || echo "No changes to commit"
git push origin HEAD:${{ github.ref_name }}
- name: Upload release artifacts
uses: softprops/action-gh-release@v2
with:
files: dist/**/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}