-
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.amzn2023
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
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@c062e08bd532815e2082a85e87e3ef29c3e6d191
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 }}