-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (52 loc) · 1.8 KB
/
Copy pathrelease.yaml
File metadata and controls
57 lines (52 loc) · 1.8 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
55
56
57
name: Release
on:
workflow_dispatch:
workflow_run:
workflows: [Test]
types:
- completed
# TODO Hi 👋 Once your SEMANTIC_RELEASE_TOKEN GitHub Secret has been setup,
# 1. remove the "check-required-secret" job
# 2. remove the "needs" field of the "release" job
# 3. remove the line with "&& needs.check-required-secret..." from "release.if"
jobs:
# [^1] remove this job once SEMANTIC_RELEASE_TOKEN has been setup
check-required-secret:
runs-on: ubuntu-latest
outputs:
is_release_token_present: ${{ steps.check-secret.outputs.is_release_token_present }}
steps:
- name: Check for secret required to run Semantic-Release Action
id: check-secret
shell: bash
run: |
if [ -n "${{ secrets.SEMANTIC_RELEASE_TOKEN }}" ]; then
echo "::set-output name=is_release_token_present::true"
else
echo "::set-output name=is_release_token_present::false"
fi
release:
# [^2] remove this "needs" field once SEMANTIC_RELEASE_TOKEN has been setup
needs: [check-required-secret]
# [^3] remove "&& needs.check-required-secret..." from below "if" expression
if: >
${{
github.event.workflow_run.conclusion == 'success'
&& needs.check-required-secret.outputs.is_release_token_present == 'true'
}}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3
with:
semantic_version: 19.0.3
extra_plugins: |
@semantic-release/changelog@6.0.1
@semantic-release/git@10.0.1
env:
GITHUB_TOKEN: ${{ secrets.SEMANTIC_RELEASE_TOKEN }}