-
Notifications
You must be signed in to change notification settings - Fork 0
94 lines (87 loc) · 2.21 KB
/
release.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Code generated by craft; DO NOT EDIT.
name: Release
run-name: Release
on:
workflow_dispatch:
inputs:
mode:
description: Whether to only make a dry_run or to make the release completely
type: choice
default: dry_run
options:
- dry_run
- release
push:
branches:
- main
- master
- v[0-9]+.x
- v[0-9]+.[0-9]+.x
jobs:
version:
name: Version
runs-on: ubuntu-latest
if: ${{ github.ref_protected }} # skip all jobs since they depend on version job
environment: release
permissions:
contents: write
issues: write
pull-requests: write
outputs:
mode: ${{ steps.mode.outputs.mode }}
release: ${{ steps.version.outputs.release }}
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- id: version
uses: ./.github/actions/version
with:
mode: dry_run # compute only the version to build
token: ${{ secrets.GITHUB_TOKEN }}
- id: mode
run: |
if [ "$GITHUB_EVENT_NAME" = "push" ]; then
echo "mode=release" >> $GITHUB_OUTPUT
exit 0
fi
echo "mode=${INPUT_MODE}" >> $GITHUB_OUTPUT
env:
INPUT_MODE: ${{ inputs.mode }}
build:
name: Build
needs: version
uses: ./.github/workflows/build.yml
with:
version: ${{ needs.version.outputs.version }}
docker:
name: Docker
needs: version
uses: ./.github/workflows/docker.yml
permissions:
contents: write
issues: write
pull-requests: write
security-events: write
with:
version: ${{ needs.version.outputs.version }}
release: ${{ needs.version.outputs.release == 'true' }}
secrets: inherit
release:
name: Release
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
issues: write
pull-requests: write
needs:
- version
- build
- docker
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/version
with:
download_dist: true
mode: ${{ needs.version.outputs.mode }}
token: ${{ secrets.GITHUB_TOKEN }}