-
Notifications
You must be signed in to change notification settings - Fork 11
64 lines (55 loc) · 1.58 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
# Steps:
# 1. Build the xrc
# 2. Push the release out.
name: "release"
on:
push:
tags:
- "*"
workflow_dispatch:
permissions:
contents: write
jobs:
release:
name: "Release"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build canister
uses: ./.github/actions/build
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Show output
run: |
ls -l $(find ./out)
- name: Determine tag name
id: tag
run: |
set -euxo pipefail
if [[ ${{github.event_name}} = "workflow_dispatch" ]]; then
tag_name="$(date +%Y.%m.%d)"
index=0
# If there is already a tag with the same name, try appending ".${next_integer}".
while git show-ref --tags --verify --quiet "refs/tags/${tag_name}"; do
echo "Tag ${tag_name} already exists."
index=$((index + 1))
tag_name="$(date +%Y.%m.%d).${index}"
echo "Trying tag ${tag_name}."
done
echo "Tagging as '${tag_name}'"
git tag "${tag_name}"
git push origin "refs/tags/${tag_name}"
else
tag_name="${{github.GITHUB_REF}}"
fi
echo "tag_name=${tag_name}" >> "$GITHUB_OUTPUT"
- name: Release
uses: "softprops/action-gh-release@v1"
with:
files: |
./out/xrc.wasm.gz
./out/xrc_mock.wasm.gz
tag_name: ${{ steps.tag.outputs.tag_name }}
draft: true