-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (94 loc) · 3.4 KB
/
Copy pathlinux.yaml
File metadata and controls
112 lines (94 loc) · 3.4 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Build, Test & Push binaries (Linux)
permissions:
contents: write
on:
pull_request:
push:
paths-ignore:
- '.clang-format'
- '.gitignore'
- 'License.md'
- 'README.md'
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
arch: [x86_64]
kind: [static, shared]
mode: [debug, release, releasedbg, minsizerel]
runs-on: ${{ matrix.os }}
steps:
- name: Get current date as package key
id: cache_key
run: echo "key=$(date +'%W')_${{ matrix.os }}_${{ matrix.arch }}_${{ matrix.kind }}_${{ matrix.mode }}" >> $GITHUB_OUTPUT
shell: bash
- name: Set OUTPUT_FILE variable
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
echo "OUTPUT_FILE=${{ matrix.os }}_${{ matrix.arch }}_${{ matrix.kind }}_${{ matrix.mode }}_${{ env.VS_RUNTIME_STRING }}.tar.gz" >> $GITHUB_ENV
else
echo "OUTPUT_FILE=${{ matrix.os }}_${{ matrix.arch }}_${{ matrix.kind }}_${{ matrix.mode }}.tar.gz" >> $GITHUB_ENV
fi
shell: bash
# Force xmake to a specific folder (for cache)
- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV
shell: bash
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Clone the whole repository to get correct tags and branches
# Install xmake
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1.2.2
with:
xmake-version: branch@dev
#xmake-version: latest
actions-cache-folder: .xmake-cache-W${{ steps.cache_key.outputs.key }}
# Update xmake repository (in order to have the file that will be cached)
- name: Update xmake repository
run: xmake repo --update -vD
- name: Configure xmake and install dependencies
run: xmake config -vD --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --kind=${{ matrix.kind }} --yes --policies=package.precompiled:n
- name: Build all targets
run: xmake build -vD -a
# We can't do --group=TESTS because every test has its own output
- name: Run tests
run: xmake run -vD --group=TESTS
- name: Install
run: xmake install -vDo dest/ --group=EXES
- name: Archive result
uses: ihiroky/archive-action@v1
with:
root_dir: dest
file_path: ${{ env.OUTPUT_FILE }}
verbose: true
- name: Compute checksum of archive
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
sha256sum -b "$OUTPUT_FILE" > "$OUTPUT_FILE.sha256"
else
shasum -a 256 -b "$OUTPUT_FILE" > "$OUTPUT_FILE.sha256"
fi
shell: bash
# Release tags (for tags)
- name: Upload binaries to release (Tag)
uses: svenstaro/upload-release-action@v2
if: ${{ startsWith(github.event.ref, 'refs/tags/') }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.OUTPUT_FILE }}
asset_name: ${{ env.OUTPUT_FILE }}
tag: ${{ github.ref }}
overwrite: true
- name: Upload checksum to release (Tag)
uses: svenstaro/upload-release-action@v2
if: ${{ startsWith(github.event.ref, 'refs/tags/') }}
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.OUTPUT_FILE }}.sha256
asset_name: ${{ env.OUTPUT_FILE }}.sha256
tag: ${{ github.ref }}
overwrite: true