-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (99 loc) · 3.43 KB
/
Copy pathrelease-rencrypt.yml
File metadata and controls
117 lines (99 loc) · 3.43 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
113
114
115
116
117
name: Release rencrypt
on:
workflow_dispatch:
inputs:
tag:
description: "Release tag (example: rencrypt-v1.2.3)"
required: true
type: string
release_name:
description: "Release name"
required: false
default: ""
type: string
permissions:
contents: write
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- runner: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: rencrypt-x86_64-pc-windows-msvc
binary_name: rencrypt.exe
- runner: ubuntu-latest
target: x86_64-unknown-linux-musl
artifact_name: rencrypt-x86_64-unknown-linux-musl
binary_name: rencrypt
- runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: rencrypt-x86_64-unknown-linux-gnu
binary_name: rencrypt
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
artifact_name: rencrypt-aarch64-unknown-linux-gnu
binary_name: rencrypt
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
artifact_name: rencrypt-aarch64-unknown-linux-musl
binary_name: rencrypt
- runner: macos-26-intel
target: x86_64-apple-darwin
artifact_name: rencrypt-x86_64-apple-darwin
binary_name: rencrypt
- runner: macos-latest
target: aarch64-apple-darwin
artifact_name: rencrypt-aarch64-apple-darwin
binary_name: rencrypt
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install Linux build dependencies
if: startsWith(matrix.runner, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Build rencrypt
run: cargo build --manifest-path rencrypt/Cargo.toml --release --target ${{ matrix.target }}
- name: Package binary
shell: bash
run: |
mkdir -p dist
cp "rencrypt/target/${{ matrix.target }}/release/${{ matrix.binary_name }}" "dist/${{ matrix.binary_name }}"
tar -czf "${{ matrix.artifact_name }}.tar.gz" -C dist "${{ matrix.binary_name }}"
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_name }}.tar.gz
release:
name: Publish GitHub release
runs-on: ubuntu-latest
needs: build
steps:
- name: Download all artifacts
uses: actions/download-artifact@v5
with:
path: artifacts
- name: Prepare release assets
run: |
mkdir -p release-assets
find artifacts -type f -name "*.tar.gz" -exec cp {} release-assets/ \;
ls -la release-assets
- name: Create release
uses: ncipollo/release-action@v1
with:
tag: ${{ github.event.inputs.tag }}
name: ${{ github.event.inputs.release_name != '' && github.event.inputs.release_name || github.event.inputs.tag }}
artifacts: "release-assets/*.tar.gz"
makeLatest: true
allowUpdates: true
replacesArtifacts: true