-
Notifications
You must be signed in to change notification settings - Fork 2
108 lines (89 loc) · 2.69 KB
/
Copy pathrelease.yml
File metadata and controls
108 lines (89 loc) · 2.69 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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
workflow_call:
jobs:
build-release:
name: Build Release (${{ matrix.os }}, ${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-linux
artifact: zigeth-linux-x86_64.tar.gz
- os: ubuntu-latest
target: aarch64-linux
artifact: zigeth-linux-aarch64.tar.gz
- os: macos-latest
target: x86_64-macos
artifact: zigeth-macos-x86_64.tar.gz
- os: macos-latest
target: aarch64-macos
artifact: zigeth-macos-aarch64.tar.gz
- os: windows-latest
target: x86_64-windows
artifact: zigeth-windows-x86_64.zip
env:
ZIG_GLOBAL_CACHE_DIR: ${{ github.workspace }}/.zig-cache/global
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Zig
uses: mlugg/setup-zig@v2
with:
version: 0.16.0
use-cache: false
- name: Create cache directories (Unix)
if: runner.os != 'Windows'
run: mkdir -p .zig-cache/global
- name: Create cache directories (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: New-Item -Path ".zig-cache/global" -ItemType Directory -Force
- name: Build Release
run: zig build -Doptimize=ReleaseFast
- name: Create Archive (Unix)
if: runner.os != 'Windows'
run: |
cd zig-out
tar czf ../${{ matrix.artifact }} *
- name: Create Archive (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
cd zig-out
Compress-Archive -Path * -DestinationPath ../${{ matrix.artifact }}
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
create-release:
name: Create Release
runs-on: ubuntu-latest
needs: build-release
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Display structure of downloaded files
run: ls -R artifacts/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}