-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.31 KB
/
versioned_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
name: "Versioned Release"
on:
push:
branches:
- main
jobs:
versioned-release:
name: Generate a new release if a version has been updated
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Updated Version File
id: updated-version-file
uses: tj-actions/changed-files@v39
with:
files: |
internal/version/VERSION
- name: Generate Release Tag
if: steps.updated-version-file.outputs.any_changed == 'true'
id: release-tag
run: |
echo "release_tag=$(scripts/print_version.sh internal/version/VERSION)" >> $GITHUB_OUTPUT
- name: Prerelease check
if: steps.updated-version-file.outputs.any_changed == 'true'
id: prerelease-check
run: |
echo "prerelease_check=$(scripts/prerelease_check.sh internal/version/VERSION)" >> $GITHUB_OUTPUT
- name: Create Release
if: steps.updated-version-file.outputs.any_changed == 'true'
id: create-release
uses: ncipollo/release-action@v1
with:
tag: "${{ steps.release-tag.outputs.release_tag }}"
commit: "${{ github.sha }}"
prerelease: steps.prerelease-check.outputs.prerelease_check == 'true'