-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (68 loc) · 1.93 KB
/
release.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
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
name: Release
on:
push:
tags:
- v*.*.*
jobs:
test:
name: Test
uses: KonishchevDmitry/binup/.github/workflows/test.yml@master
build:
name: Build for ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
# See https://bit.ly/github-runners for actual runners
- name: Ubuntu 20.04
os: ubuntu-20.04
- name: Intel MacOS
os: macos-13
- name: ARM MacOS
os: macos-14
steps:
- uses: actions/checkout@v4
- name: Configure build target
run: .github/configure-build-target
- name: Build
env:
CARGO_TERM_COLOR: always
run: cargo build --release --locked
- name: Check the binary
run: .github/check-binary release
- name: Create archive
id: archive
run: |
set -eu
name="binup-${{ runner.os }}-${{ runner.arch }}-${{ github.ref_name }}.tar.bz2"
name="$(tr '[:upper:]' '[:lower:]' <<< "$name")"
echo "name=$name" >> "$GITHUB_OUTPUT"
build_directory="target/${CARGO_BUILD_TARGET:-}/release"
sudo chown 0:0 "$build_directory/binup"
tar -cjf "$name" -C "$build_directory" binup
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.config.os }}
path: ${{ steps.archive.outputs.name }}
if-no-files-found: error
compression-level: 0
retention-days: 1
publish:
name: Publish
needs: [test, build]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
pattern: "*"
merge-multiple: true
- name: Create release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: artifacts/*
file_glob: true