-
Notifications
You must be signed in to change notification settings - Fork 4
38 lines (35 loc) · 1.18 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
name: Create GitHub Release
on:
# Run on demand
workflow_dispatch:
# Run on push to main when amzn2 version is updated
push:
branches:
- main
paths:
- Dockerfile.amzn2
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0
- run: git fetch --tags --force origin # WA: https://github.com/actions/checkout/issues/882
- name: Test release condition
id: release
run: |
RELEASE=false
if make release/test 2> /dev/null; then RELEASE=true; fi
echo "condition=${RELEASE}" >> "$GITHUB_OUTPUT"
echo "version=$(make release/version)" >> "$GITHUB_OUTPUT"
- name: Create release
if: steps.release.outputs.condition == 'true'
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
name: ${{ steps.release.outputs.version }}
tag_name: ${{ steps.release.outputs.version }}
generate_release_notes: true
target_commitish: ${{ env.GITHUB_REF }}
token: ${{ secrets.GH_RELEASES_TOKEN }}