-
Notifications
You must be signed in to change notification settings - Fork 18
49 lines (49 loc) · 1.61 KB
/
patch-version.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
on:
workflow_dispatch: # allows manual triggering
inputs:
level:
description: 'Release a patch version on the release branch, `auto` follow the last version level.'
required: true
default: 'auto'
type: choice
options:
- 'auto'
- 'beta'
- 'rc'
- 'patch'
permissions:
contents: write
name: "Patch Version"
jobs:
release_level:
runs-on: ubuntu-latest
outputs:
level: ${{ steps.concrete_level.outputs.level }}
steps:
- name: Release branch check
if: startsWith(github.ref, 'refs/heads/release-') != true
run: |
echo "You should only run this workflow on the release branch."
exit 1
- uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-tags: true
- id: auto_detect
if: ${{ github.event.inputs.level == 'auto' || github.event.inputs.level == '' }}
run: echo "level=$(git describe --tags --abbrev=0 | grep -o "rc\|beta")" >> $GITHUB_OUTPUT
- id: concrete_level
run: |
level=${{ steps.auto_detect.outputs.level }}
echo "level=${level:=${{inputs.level}}}" >> $GITHUB_OUTPUT
call-workflow-passing-data:
needs: release_level
uses: RibirX/rclog/.github/workflows/release-version.yml@main
with:
level: ${{ needs.release_level.outputs.level }}
ref: ${{ github.ref }}
merge_changelog: ${{ needs.release_level.outputs.level == 'patch' }}
toolchain: stable
secrets:
CRATE_RELEASE_TOKEN: ${{ secrets.CRATE_RELEASE_TOKEN }}
GITHUB_RELEASE_TOKEN: ${{ secrets.RIBIR_RELEASE }}