-
-
Notifications
You must be signed in to change notification settings - Fork 50
59 lines (50 loc) · 1.96 KB
/
tag.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
name: "tag -> create release"
on:
push:
tags: [ '*' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# need this for figuring out the branch name
# (see https://stackoverflow.com/questions/63745613/how-to-get-a-branch-name-on-github-action-when-push-on-a-tag)
fetch-depth: 0
- name: Get branch name
id: branch-name
run: |
raw=$(git branch -r --contains ${{ github.ref }})
branch=${raw##*/}
echo "branch=$branch" >> $GITHUB_OUTPUT
- name: Set up build environment and dependencies
uses: ./.github/actions/setup
- name: Build and package library with Ant
run: ant dist dist-android
- name: "v* tags only: create version release draft"
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
draft: true
generate_release_notes: true
files: |
../sound.zip
../sound-android.zip
../sound.txt
- name: "`latest` tag only: build latest library download release"
uses: softprops/action-gh-release@v1
if: github.ref == 'refs/tags/latest'
# just override the assets, otherwise leave the existing release unchanged
with:
files: |
../sound.zip
../sound.txt
- name: "all other tags: create preliminary test build release"
uses: softprops/action-gh-release@v1
if: github.ref != 'refs/tags/latest' && !startsWith(github.ref, 'refs/tags/v')
with:
name: ${{ github.ref_name }} dev build
prerelease: true
body: Dev build of commit ${{ github.sha }} by ${{ github.actor }} from the [${{ steps.branch-name.outputs.branch }}](https://github.com/${{ github.repository }}/tree/${{ steps.branch-name.outputs.branch }}) branch
generate_release_notes: true
files: ../sound.zip