-
Notifications
You must be signed in to change notification settings - Fork 54
56 lines (53 loc) · 2.07 KB
/
create-release.yaml
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
name: Create Release
on:
push:
tags:
- 'OVIS-4*'
- 'v[0-9]+.[0-9]+.[0-9]+**'
jobs:
build:
name: Create Release
# Make sure that test-make-dist.yaml has the same "runs-on" and
# "container" as used here.
runs-on: ubuntu-20.04
container:
image: ovishpc/ovis-ubuntu-build
steps:
- uses: actions/checkout@v3
# actions/checkout breaks annotated tags by converting them into
# lightweight tags, so we need to force fetch the tag again
# See: https://github.com/actions/checkout/issues/290
- name: Repair tag
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }}
- name: Verify tag is annotated
run: if test x$(git for-each-ref ${{ github.ref }} | awk '{print $2}') = xtag; then /bin/true; else echo "\"${{ github.ref }}\" does not look like an annotated tag!"; /bin/false; fi
- name: autogen.sh
run: sh autogen.sh
- name: configure
run: ./configure
- name: make dist
run: |
make dist
echo TARBALL_NAME=$(ls *.tar.gz | head -1) >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./${{ env.TARBALL_NAME }}
dispatch-container-bake:
needs: [ build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: dispatch ldms-containers bake
run: |
set -e
sed -i "s|LDMS_TAG|${{github.ref_name}}|" .github/data/dispatch.yaml
sed -i "s|LDMS_REPO_URL|${{github.server_url}}/${{github.repository}}|" .github/data/dispatch.yaml
python3 -c 'import sys,yaml,json; print(json.dumps(yaml.load(sys.stdin, yaml.SafeLoader)))' < .github/data/dispatch.yaml > dispatch.json
curl -L -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{secrets.NARATEGITHUB_LDMS_CONTAINERS_TOKEN}}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
-d "@dispatch.json" \
"https://api.github.com/repos/narategithub/ldms-containers/actions/workflows/on_ldms_release.yaml/dispatches"