-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (61 loc) · 2.24 KB
/
ci.yaml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
name: CI
'on':
push:
branches: [main, 'renovate/**']
pull_request:
types: [opened, synchronize]
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run'
default: false
required: false
type: boolean
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
release:
env:
DRY_RUN: ${{ github.event_name == 'pull_request' || github.event.inputs.dry_run && 'true' || 'false' }}
FORCE_COLOR: true
name: Release
runs-on: ubuntu-latest
steps:
- name: Get Workflow Access Token
id: get-workflow-access-token
uses: peter-murray/workflow-application-token-action@8e1ba3bf1619726336414f1014e37f17fbadf1db # v2.1.0
with:
application_id: ${{ secrets.APPLICATION_ID }}
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }}
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
token: ${{ steps.get-workflow-access-token.outputs.token }}
- name: Setup Node.js
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4.0.1
with:
node-version: '18.x'
- name: Get Release Options
env:
IS_DEFAULT_BRANCH: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
run: |
if [[ $DRY_RUN != 'true' || $IS_DEFAULT_BRANCH == 'true' ]]; then
echo "DRY_RUN=false" >> $GITHUB_ENV
fi
- name: Semantic Release
env:
CI_FLAG: ${{ env.DRY_RUN == 'true' && 'false' || 'true' }}
GIT_AUTHOR_EMAIL: '118100583+bfra-me[bot]@users.noreply.github.com'
GIT_AUTHOR_NAME: 'bfra-me[bot]'
GIT_COMMITTER_EMAIL: '118100583+bfra-me[bot]@users.noreply.github.com'
GIT_COMMITTER_NAME: 'bfra-me[bot]'
GITHUB_TOKEN: ${{ steps.get-workflow-access-token.outputs.token }}
run: |
# Run `semantic-release`
npm install [email protected]
npx [email protected] --dry-run ${{ env.DRY_RUN }} --ci ${{ env.CI_FLAG }}