This repository was archived by the owner on Feb 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (54 loc) · 1.81 KB
/
c.yml
File metadata and controls
70 lines (54 loc) · 1.81 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: C
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
env:
BUILD_TYPE: Release
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Configure CMake
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }}
- name: Rename
run: >
mv
${{ github.workspace }}/build/${{ matrix.os == 'windows-latest' && format('{0}/crack.exe', env.BUILD_TYPE) || 'crack' }}
${{ github.workspace }}/build/${{ matrix.os }}-crack${{ matrix.os == 'windows-latest' && '.exe' || '' }}
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}-artifact
path: ${{ github.workspace }}/build/${{ matrix.os }}-crack${{ matrix.os == 'windows-latest' && '.exe' || '' }}
release:
if: github.event_name == 'push'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v2
with:
path: ${{ github.workspace }}/build
- name: Tag
id: tag
run: |
tag=$(git log -n1 --format="%h")
git config --local user.email "programripper@foxmail.com"
git config --local user.name "ProgramRipper"
git tag -a $tag -m $tag
git push --tags
echo tag=$tag >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.tag.outputs.tag }}
files: ${{ github.workspace }}/build/*-artifact/*