-
Notifications
You must be signed in to change notification settings - Fork 4
87 lines (72 loc) · 2.19 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
name: Publish release on tag creation
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
check_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Get shortened version of release tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Check release version is set correctly in every file
run: python3 utilities/check-version.py ${{ env.RELEASE_VERSION }}
run_tests:
uses: ./.github/workflows/ci.yml
needs:
- check_version
package:
name: Package source files
runs-on: ubuntu-latest
needs:
- check_version
- run_tests
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Get shortened version of release tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Package source code
shell: bash
run: |
find * | grep -v "\.git\|pytest.ini" | tar -czvf HAMLET-${{ env.RELEASE_VERSION }}.tar.gz --files-from -
- name: Print event context
env:
EVENT_CONTEXT: ${{ toJSON(github.event) }}
run: |
echo $EVENT_CONTEXT
- name: Upload archive as artifact
uses: actions/upload-artifact@v4
with:
name: release-tar
path: HAMLET-${{ env.RELEASE_VERSION }}.tar.gz
retention-days: 1
release:
name: Create release
needs:
- check_version
- run_tests
- package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Get shortened version of release tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Download release tarball
uses: actions/download-artifact@v4
with:
name: release-tar
- name: Create release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create \
${{ env.RELEASE_VERSION}} \
--generate-notes \
HAMLET-${{ env.RELEASE_VERSION}}.tar.gz \