Skip to content

Commit fbf8981

Browse files
committed
Auto build & release
1 parent 63f8ed5 commit fbf8981

File tree

3 files changed

+67
-112
lines changed

3 files changed

+67
-112
lines changed

Diff for: .github/workflows/ci.yaml

+66-74
Original file line numberDiff line numberDiff line change
@@ -15,84 +15,76 @@ permissions:
1515
# Sets permission policy for `GITHUB_TOKEN`
1616
contents: read
1717
jobs:
18-
aarch64-macos-debug:
19-
runs-on: macos-13-xlarge
20-
env:
21-
ARCH: "aarch64"
22-
TARGET: "aarch64-macos-none"
23-
CACHE_BASENAME: "zig+llvm+lld+clang-aarch64-macos-none-0.14.0-dev.1622+2ac543388"
24-
MCPU: "baseline"
25-
BUILD_TYPE: "Debug"
18+
build:
19+
runs-on: big-ubuntu
20+
strategy:
21+
matrix:
22+
target:
23+
- x86_64-macos-none
24+
- x86_64-linux-musl
25+
- x86_64-windows-gnu
26+
- aarch64-macos-none
27+
- aarch64-linux-musl
2628
steps:
27-
- name: Checkout
28-
uses: actions/checkout@v4
29-
- name: Cache Zig toolchain
30-
uses: actions/cache@v4
29+
- run: sudo apt-get install -y ninja-build
30+
- uses: actions/checkout@v4
3131
with:
32-
path: ${{ runner.home }}/${{ env.CACHE_BASENAME }}
33-
key: ${{ env.CACHE_BASENAME }}
34-
restore-keys: |
35-
${{ env.CACHE_BASENAME }}
36-
- name: Install Ninja
37-
run: brew install ninja
38-
- name: Build
39-
run: ci/macos.sh
40-
- name: Upload Artifact
41-
uses: actions/upload-artifact@v4
32+
repository: ziglang/zig-bootstrap
33+
ref: 50d8e88ba329b5d58a212f9fd2e9b1ad59a88e7d
34+
- run: rm -rf zig
35+
- uses: actions/checkout@v4
4236
with:
43-
name: aarch64-macos-debug
44-
path: build/stage3/bin/zig
45-
aarch64-macos-release:
46-
runs-on: macos-13-xlarge
47-
env:
48-
ARCH: "aarch64"
49-
TARGET: "aarch64-macos-none"
50-
CACHE_BASENAME: "zig+llvm+lld+clang-aarch64-macos-none-0.14.0-dev.1622+2ac543388"
51-
MCPU: "baseline"
52-
BUILD_TYPE: "Release"
53-
steps:
54-
- name: Checkout
55-
uses: actions/checkout@v4
56-
- name: Cache Zig toolchain
57-
uses: actions/cache@v4
58-
with:
59-
path: ${{ runner.home }}/${{ env.CACHE_BASENAME }}
60-
key: ${{ env.CACHE_BASENAME }}
61-
restore-keys: |
62-
${{ env.CACHE_BASENAME }}
63-
- name: Install Ninja
64-
run: brew install ninja
65-
- name: Build
66-
run: ci/macos.sh
67-
- name: Upload Artifact
68-
uses: actions/upload-artifact@v4
37+
path: zig
38+
- run: sed -i 's/ZIG_VERSION="0.14.0-dev.2257+e6d2e1641"/ZIG_VERSION="0.14.0-dev.2987+183bb8b08"/' build
39+
- run: cat build
40+
- run: CMAKE_GENERATOR=Ninja ./build ${{ matrix.target }} baseline
41+
- uses: actions/upload-artifact@v4
6942
with:
70-
name: aarch64-macos-release
71-
path: build/stage3/bin/zig
72-
x86_64-macos-release:
73-
runs-on: macos-13-large
74-
env:
75-
ARCH: "x86_64"
76-
TARGET: "x86_64-macos-none"
77-
CACHE_BASENAME: "zig+llvm+lld+clang-x86_64-macos-none-0.14.0-dev.1622+2ac543388"
78-
MCPU: "baseline"
79-
BUILD_TYPE: "Release"
43+
name: bootstrap-${{ matrix.target }}
44+
path: out/zig-${{ matrix.target }}-baseline
45+
release:
46+
needs: build
47+
permissions:
48+
contents: write
49+
runs-on: big-ubuntu
8050
steps:
81-
- name: Checkout
82-
uses: actions/checkout@v4
83-
- name: Cache Zig toolchain
84-
uses: actions/cache@v4
51+
- uses: actions/checkout@v4
8552
with:
86-
path: ${{ runner.home }}/${{ env.CACHE_BASENAME }}
87-
key: ${{ env.CACHE_BASENAME }}
88-
restore-keys: |
89-
${{ env.CACHE_BASENAME }}
90-
- name: Install Ninja
91-
run: brew install ninja
92-
- name: Build
93-
run: ci/macos.sh
94-
- name: Upload Artifact
95-
uses: actions/upload-artifact@v4
53+
repository: zigtools/zls
54+
ref: d746d19a27729c519c58581838e17e733d35444d
55+
- uses: actions/download-artifact@v4
56+
- name: chmod
57+
run: |
58+
chmod +x bootstrap-x86_64-macos-none/zig
59+
chmod +x bootstrap-x86_64-linux-musl/zig
60+
chmod +x bootstrap-x86_64-windows-gnu/zig.exe
61+
chmod +x bootstrap-aarch64-macos-none/zig
62+
chmod +x bootstrap-aarch64-linux-musl/zig
63+
- name: Build ZLS
64+
run: |
65+
./bootstrap-x86_64-linux-musl/zig build -Doptimize=ReleaseSafe -Dtarget=x86_64-macos-none --prefix . --prefix-exe-dir ./bootstrap-x86_64-macos-none &
66+
./bootstrap-x86_64-linux-musl/zig build -Doptimize=ReleaseSafe -Dtarget=x86_64-linux-musl --prefix . --prefix-exe-dir ./bootstrap-x86_64-linux-musl &
67+
./bootstrap-x86_64-linux-musl/zig build -Doptimize=ReleaseSafe -Dtarget=x86_64-windows-gnu --prefix . --prefix-exe-dir ./bootstrap-x86_64-windows-gnu &
68+
./bootstrap-x86_64-linux-musl/zig build -Doptimize=ReleaseSafe -Dtarget=aarch64-macos-none --prefix . --prefix-exe-dir ./bootstrap-aarch64-macos-none &
69+
./bootstrap-x86_64-linux-musl/zig build -Doptimize=ReleaseSafe -Dtarget=aarch64-linux-musl --prefix . --prefix-exe-dir ./bootstrap-aarch64-linux-musl &
70+
wait
71+
- name: Compress artifacts
72+
run: |
73+
zip -r bootstrap-x86_64-macos-none.zip bootstrap-x86_64-macos-none &
74+
zip -r bootstrap-x86_64-linux-musl.zip bootstrap-x86_64-linux-musl &
75+
zip -r bootstrap-x86_64-windows-gnu.zip bootstrap-x86_64-windows-gnu &
76+
zip -r bootstrap-aarch64-macos-none.zip bootstrap-aarch64-macos-none &
77+
zip -r bootstrap-aarch64-linux-musl.zip bootstrap-aarch64-linux-musl &
78+
wait
79+
- name: Release
80+
uses: softprops/action-gh-release@v1
81+
id: release
9682
with:
97-
name: x86_64-macos-release
98-
path: build/stage3/bin/zig
83+
generate_release_notes: true
84+
tag_name: "autobuild-${{github.sha}}"
85+
files: |
86+
bootstrap-x86_64-macos-none.zip
87+
bootstrap-x86_64-linux-musl.zip
88+
bootstrap-x86_64-windows-gnu.zip
89+
bootstrap-aarch64-macos-none.zip
90+
bootstrap-aarch64-linux-musl.zip

Diff for: ci/macos.sh

-38
This file was deleted.

Diff for: lib/std/debug.zig

+1
Original file line numberDiff line numberDiff line change
@@ -1684,6 +1684,7 @@ test SafetyLock {
16841684
/// When Valgrind integrations are disabled, this returns comptime-known false.
16851685
/// Otherwise, the result is runtime-known.
16861686
pub inline fn inValgrind() bool {
1687+
if (@hasDecl(builtin, "sanitize_address") and builtin.sanitize_address) return true;
16871688
if (@inComptime()) return false;
16881689
if (!builtin.valgrind_support) return false;
16891690
return std.valgrind.runningOnValgrind() > 0;

0 commit comments

Comments
 (0)