Repository navigation
124 lines (117 loc) · 3.48 KB
/
Copy pathrelease.yaml
File metadata and controls
124 lines (117 loc) · 3.48 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
118
119
120
121
122
123
124
name: Release
permissions:
contents: read
on:
push:
tags:
- v[0-9]+.*
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
test:
uses: ./.github/workflows/ci.yaml
build:
name: "Upload ${{ matrix.target }} Binaries"
if: github.repository_owner == 'rwf2'
needs: test
timeout-minutes: 60
runs-on: ${{ matrix.os || 'ubuntu-22.04' }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-unknown-linux-gnu
- target: aarch64-unknown-linux-musl
- target: aarch64-apple-darwin
os: macos-15
- target: aarch64-pc-windows-msvc
os: windows-2025
- target: x86_64-unknown-linux-gnu
- target: x86_64-unknown-linux-musl
- target: x86_64-apple-darwin
os: macos-15-intel
- target: x86_64-pc-windows-msvc
os: windows-2025
- target: x86_64-unknown-freebsd
- target: universal-apple-darwin
os: macos-15
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Configure Cross Compiler
uses: taiki-e/setup-cross-toolchain-action@v1
if: runner.os == 'Linux'
with:
target: ${{ matrix.target }}
runner: none
- name: Set RUSTFLAGS
run: |
if [[ ${{ matrix.target }} == *-windows-msvc ]]; then
echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static" >> "${GITHUB_ENV}"
elif [[ ${{ matrix.target }} == *-linux-musl ]]; then
echo "RUSTFLAGS=${RUSTFLAGS} -C target-feature=+crt-static -C link-self-contained=yes" >> "${GITHUB_ENV}"
fi
- name: Build Archives
uses: taiki-e/upload-rust-binary-action@v1
id: build
with:
bin: mockingbird
target: ${{ matrix.target }}
locked: true
checksum: sha256
archive: $bin-$tag-$target
tar: all
zip: windows
dry-run: true
- name: Upload Binaries
uses: actions/upload-artifact@v7
with:
name: binaries-${{ matrix.target }}
path: ${{ steps.build.outputs.archive }}.*
if-no-files-found: error
release:
name: "GitHub Release"
needs: build
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- name: Check Release Branch
run: git merge-base --is-ancestor HEAD origin/master
- name: Download Binaries
uses: actions/download-artifact@v8
with:
pattern: binaries-*
merge-multiple: true
path: dist
- name: Create GitHub Release
uses: ncipollo/release-action@v1
id: release
with:
name: Mockingbird ${{ github.ref_name }}
artifacts: dist/*
artifactErrorsFailBuild: true
generateReleaseNotes: true
draft: true
allowUpdates: true
updateOnlyUnreleased: true
skipIfReleaseExists: true
- name: Publish
if: steps.release.outputs.id != ''
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
run: gh release edit "$GITHUB_REF_NAME" --draft=false