-
Notifications
You must be signed in to change notification settings - Fork 43
56 lines (47 loc) · 1.77 KB
/
update_release.yml
File metadata and controls
56 lines (47 loc) · 1.77 KB
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: Download
on:
push:
branches:
- master
- develop
tags:
- v*
jobs:
build_4cc:
uses: ./.github/workflows/build.yml
publish_release:
if: github.ref_type == 'tag' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop'
needs: build_4cc
name: Upload Release
runs-on: ubuntu-latest
permissions:
contents: write
env:
GH_TOKEN: ${{ github.token }}
RELEASE_NAME: ${{ github.ref_type == 'tag' && github.ref_name || github.ref == 'refs/heads/develop' && 'unstable' || 'latest' }}
RELEASE_TITLE: ${{ github.ref_type == 'tag' && github.ref_name || github.ref == 'refs/heads/develop' && 'Unstable' || 'Latest' }}
RELEASE_TARGET: ${{ github.sha }}
RELEASE_PRERELEASE_FLAG: ${{ github.ref == 'refs/heads/develop' && '--prerelease' || '' }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create Release Exists
run: |
if ! gh release view "$RELEASE_NAME" --repo "${{ github.repository }}"; then
gh release create "$RELEASE_NAME" --repo "${{ github.repository }}" --title "$RELEASE_TITLE" --target "$RELEASE_TARGET" $RELEASE_PRERELEASE_FLAG --notes " "
fi
- name: Download 4cc Artifacts
uses: actions/download-artifact@v4
with:
path: artifacts_dir
pattern: 4cc-*
- run: |
cd artifacts_dir
for f in ./* ; do zip -r "$f.zip" $f ; done;
- name: Upload to Release
run: gh release upload "$RELEASE_NAME" artifacts_dir/4cc-*.zip --repo "${{ github.repository }}" --clobber
- name: Update Rolling Release Tag
if: github.ref_type != 'tag'
run: |
git tag -f "$RELEASE_NAME" "$RELEASE_TARGET"
git push --force origin "refs/tags/$RELEASE_NAME"