This repository has been archived by the owner on Jun 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
59 lines (50 loc) · 1.86 KB
/
ci-cd.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
name: CI/CD
on:
pull_request:
branches:
- main
- beta
push:
branches:
- main
- beta
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
ci_cd:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Build
run: cmake . -B build && cmake --build build --config Debug && cmake --build build --config Release
- name: Parse git commit
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' }}
run: echo GH_REL_TAG=$(git rev-parse --short HEAD 2> /dev/null | sed "s/\(.*\)/v0-\1/") >> $GITHUB_ENV
# Remotely we create and push the tag
- name: Create Release Tag
run: git tag ${{ env.GH_REL_TAG }} && git push origin ${{ env.GH_REL_TAG }}
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' }}
# Locally we debug the tag parse
- run: echo ${{ env.GH_REL_TAG }}
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' }}
- name: Package Public
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' }}
shell: pwsh
run: |
mkdir rel
Compress-Archive -Path build/bin/Release -DestinationPath rel/native-examples-rel-${{ env.GH_REL_TAG }}.zip &&
Compress-Archive -Path build/bin/Debug -DestinationPath rel/native-examples-dbg-${{ env.GH_REL_TAG }}.zip &&
echo "Packaged."
# Remotely we create the release from the tag
- name: GH Release
if: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta' }}
uses: softprops/action-gh-release@v0.1.14
with:
tag_name: ${{ env.GH_REL_TAG }}
prerelease: ${{ github.ref != 'refs/heads/main' }}
generate_release_notes: true
files: rel/*.zip