This repository was archived by the owner on Nov 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (67 loc) · 2.48 KB
/
release.yml
File metadata and controls
82 lines (67 loc) · 2.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
name: release
on:
push:
tags:
- 'v*'
defaults:
run:
shell: bash
jobs:
build:
name: target = ${{ matrix.build.target }}
runs-on: ${{ matrix.build.os }}
strategy:
fail-fast: false
matrix:
build:
- { os: ubuntu-latest, exe: , zig: false, build: build, target: x86_64-unknown-linux-gnu }
- { os: macos-latest, exe: , zig: false, build: build, target: x86_64-apple-darwin }
- { os: windows-latest, exe: .exe, zig: false, build: build, target: x86_64-pc-windows-msvc }
- { os: ubuntu-latest, exe: , zig: true, build: zigbuild, target: aarch64-apple-darwin }
steps:
- name: checkout
uses: actions/checkout@v4
- name: install rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.build.target }}
override: true
- name: install zig
uses: goto-bus-stop/setup-zig@v2
if: ${{ matrix.build.zig }}
- name: install cargo-zigbuild
run: cargo install cargo-zigbuild
if: ${{ matrix.build.zig }}
- name: build codegen executable
run: cargo ${{ matrix.build.build }} --example codegen --release --target ${{ matrix.build.target }}
- name: give executable representable name
run: cp target/${{ matrix.build.target }}/release/examples/codegen${{ matrix.build.exe }} ./codegen-${{ matrix.build.target }}${{ matrix.build.exe }}
- name: upload executable
uses: actions/upload-artifact@v4
with:
name: codegen-${{ matrix.build.target }}${{ matrix.build.exe }}
path: codegen-${{ matrix.build.target }}${{ matrix.build.exe }}
make-release:
name: release
needs: ['build']
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with: { name: codegen-x86_64-unknown-linux-gnu }
- uses: actions/download-artifact@v4
with: { name: codegen-x86_64-apple-darwin }
- uses: actions/download-artifact@v4
with: { name: codegen-x86_64-pc-windows-msvc.exe }
- uses: actions/download-artifact@v4
with: { name: codegen-aarch64-apple-darwin }
- name: release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
artifactErrorsFailBuild: true
artifacts: "codegen-*"
token: ${{ secrets.GITHUB_TOKEN }}