Repository navigation
95 lines (91 loc) · 2.94 KB
/
Copy pathrelease.yml
File metadata and controls
95 lines (91 loc) · 2.94 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
name: release
on:
push:
tags: ["v*"]
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: build ${{ matrix.target }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-24.04
binary: pixl
asset: pixl-linux-x86_64
- target: aarch64-apple-darwin
os: macos-15
binary: pixl
asset: pixl-macos-aarch64
- target: x86_64-pc-windows-msvc
os: windows-2025
binary: pixl.exe
asset: pixl-windows-x86_64.exe
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: restore cargo cache
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: cargo-${{ matrix.target }}-
- name: build release binary
run: cargo build --release --locked -p pixl-cli --target ${{ matrix.target }}
- name: prepare asset
shell: bash
run: |
mkdir -p dist
cp "target/${{ matrix.target }}/release/${{ matrix.binary }}" "dist/${{ matrix.asset }}"
cd dist
if command -v sha256sum >/dev/null 2>&1; then
sha256sum "${{ matrix.asset }}" > "${{ matrix.asset }}.sha256"
else
shasum -a 256 "${{ matrix.asset }}" > "${{ matrix.asset }}.sha256"
fi
- name: upload asset
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: ${{ matrix.asset }}
path: dist/*
if-no-files-found: error
- name: save cargo cache
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
publish:
name: publish release
needs: build
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
path: dist
merge-multiple: true
- name: build combined checksums
run: |
cd dist
sha256sum pixl-* > SHA256SUMS
- uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2
with:
files: dist/*
generate_release_notes: true
fail_on_unmatched_files: true