forked from ziglang/zig-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 1
66 lines (63 loc) · 2.04 KB
/
main.yml
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
name: Build compiler for Windows, Linux and Mac
on:
workflow_dispatch:
inputs:
version:
description: Version (e.g. 1.42)
required: false
type: string
jobs:
build:
name: Build zig
runs-on: ubuntu-latest
timeout-minutes: 600
strategy:
matrix:
include:
- target: x86_64-linux-musl
- target: x86_64-macos-none
- target: x86_64-windows-gnu
- target: aarch64-linux-musl
- target: aarch64-macos-none
fail-fast: false
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build
run: ./build ${{ matrix.target }} baseline
shell: bash
- name: Create tarball
run: tar -C out -cjf zig-${{ matrix.target }}.tar.bz2 zig-${{ matrix.target }}-baseline
shell: bash
- name: Upload ${{ matrix.target }} tarball
uses: actions/upload-artifact@v4
with:
name: zig-${{ matrix.target }}.tar.bz2
path: zig-${{ matrix.target }}.tar.bz2
create_release:
name: Create Release
if: github.event.inputs.version != ''
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Update the version in the README
run: sed -i 's/# solana-zig-bootstrap v.*/# solana-zig-bootstrap v${{ inputs.version }}/' README.md
- name: Commit and push tag
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git commit -am "[SOL] Publish solana-v${{ inputs.version }}"
git tag -a solana-v${{ inputs.version }} -m "[SOL] Tag solana-v${{ inputs.version }}"
git push origin --follow-tags
- name: Download tarballs into zig-bootstrap-solana/
uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Create GH Release
uses: softprops/action-gh-release@v2
with:
fail_on_unmatched_files: true
files: zig-*.tar.bz2
tag_name: solana-v${{ inputs.version }}