-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.58 KB
/
release.yml
File metadata and controls
54 lines (44 loc) · 1.58 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
50
51
52
53
54
name: Release
env:
USE_LOCKFILE: ${{ secrets.USE_LOCKFILE }}
ENABLE_RELEASE: ${{ secrets.ENABLE_RELEASE }}
on:
push:
branches: [ master, alpha, beta, build ]
repository_dispatch:
types: [ release ]
permissions:
id-token: write
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["lts/*"]
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
steps:
- uses: actions/checkout@v6
- name: Setup
uses: ./.github/actions/composite-setup
with:
USE_LOCKFILE: ${{ secrets.USE_LOCKFILE }}
- name: Build
uses: ./.github/actions/composite-build
with:
USE_LOCKFILE: ${{ secrets.USE_LOCKFILE }}
- name: Release
if: "env.ENABLE_RELEASE == 'true' && ! contains('refs/heads/build ', github.ref)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm semantic-release
- name: Release Dry Run
if: "env.ENABLE_RELEASE != 'true' || contains('refs/heads/build ', github.ref)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm semantic-release --dry-run
- run: echo "env.ENABLE_RELEASE is ${{ env.ENABLE_RELEASE == 'true' }} and branch is ${{ github.ref }}, no release can be published." && exit 1
if: "env.ENABLE_RELEASE != 'true' || contains('refs/heads/build ', github.ref)"