-
Notifications
You must be signed in to change notification settings - Fork 90
122 lines (100 loc) · 3.35 KB
/
release.yaml
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
113
114
115
116
117
118
119
120
121
122
name: Release
on:
workflow_dispatch:
permissions:
contents: write
defaults:
run:
shell: bash
jobs:
init:
name: Init
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.value }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get version from manifest
uses: SebRollen/toml-action@9062fbef52816d61278d24ce53c8070440e1e8dd
id: get_version
with:
file: Cargo.toml
field: package.version
build:
needs: ["init"]
strategy:
fail-fast: false
matrix:
include:
- name: Windows x86_64
runner-os: windows-latest
artifact-name: lune-${{ needs.init.outputs.version }}-windows-x86_64
cargo-target: x86_64-pc-windows-msvc
- name: Linux x86_64
runner-os: ubuntu-latest
artifact-name: lune-${{ needs.init.outputs.version }}-linux-x86_64
cargo-target: x86_64-unknown-linux-gnu
- name: Linux aarch64
runner-os: ubuntu-latest
artifact-name: lune-${{ needs.init.outputs.version }}-linux-aarch64
cargo-target: aarch64-unknown-linux-gnu
- name: macOS x86_64
runner-os: macos-latest
artifact-name: lune-${{ needs.init.outputs.version }}-macos-x86_64
cargo-target: x86_64-apple-darwin
- name: macOS aarch64
runner-os: macos-latest
artifact-name: lune-${{ needs.init.outputs.version }}-macos-aarch64
cargo-target: aarch64-apple-darwin
name: Build - ${{ matrix.name }}
runs-on: ${{ matrix.runner-os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.cargo-target }}
- name: Install Just
uses: extractions/setup-just@v1
- name: Install build tooling (aarch64-unknown-linux-gnu)
if: matrix.cargo-target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update -y
sudo apt-get install -y musl-tools clang llvm
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
- name: Build binary
run: just build --locked --release --target ${{ matrix.cargo-target }}
- name: Create release archive
run: just zip-release ${{ matrix.cargo-target }}
- name: Upload release artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}
path: release.zip
release:
name: Release
runs-on: ubuntu-latest
needs: ["init", "build"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Just
uses: extractions/setup-just@v1
- name: Download releases
uses: actions/download-artifact@v3
with:
path: ./releases
- name: Unpack releases
run: just unpack-releases "./releases"
- name: Create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: ${{ needs.init.outputs.version }}
tag_name: v${{ needs.init.outputs.version }}
fail_on_unmatched_files: true
files: ./releases/*.zip
draft: true