Skip to content

Commit

Permalink
chore: Move to faster builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Dustin Blackman committed Nov 30, 2023
1 parent 6550717 commit 442e59f
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 25 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ deny = ["bin", "cargo-deny"]
gha = ["bin", "cargo-gha"]
llvm-cov = ["bin", "cargo-llvm-cov"]
nextest = ["bin", "cargo-nextest"]
xwin = ["bin", "cargo-xwin"]
zigbuild = ["bin", "cargo-zigbuild"]
96 changes: 96 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
on: workflow_dispatch
name: build
jobs:
linux-amd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: x86_64-unknown-linux-gnu
- name: Build
run: cargo build --release --target x86_64-unknown-linux-gnu
- name: Upload
uses: actions/upload-artifact@v2
with:
name: x86_64-unknown-linux-gnu
path: target/x86_64-unknown-linux-gnu/release/languagetool-code-comments

linux-arm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: aarch64-unknown-linux-gnu
- name: Build
run: |
sudo apt-get install gcc-aarch64-linux-gnu
cargo install cargo-zigbuild
rustup target add aarch64-unknown-linux-gnu
cargo zigbuild --release --target aarch64-unknown-linux-gnu
- name: Upload
uses: actions/upload-artifact@v2
with:
name: aarch64-unknown-linux-gnu
path: target/aarch64-unknown-linux-gnu/release/languagetool-code-comments

macos-amd:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
target: x86_64-apple-darwin
toolchain: stable
- name: Build
run: cargo build --release --target x86_64-apple-darwin
- name: Upload
uses: actions/upload-artifact@v2
with:
name: x86_64-apple-darwin
path: target/x86_64-apple-darwin/release/languagetool-code-comments

macos-arm:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: goto-bus-stop/setup-zig@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: aarch64-apple-darwin
- name: Build
run: |
cargo install cargo-zigbuild
rustup target add aarch64-apple-darwin
cargo zigbuild --release --target aarch64-apple-darwin
- name: Upload
uses: actions/upload-artifact@v2
with:
name: aarch64-apple-darwin
path: target/aarch64-apple-darwin/release/languagetool-code-comments

windows-amd:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: x86_64-pc-windows-msvc
- name: Build
run: cargo build --release --target x86_64-pc-windows-msvc
- name: Upload
uses: actions/upload-artifact@v2
with:
name: x86_64-pc-windows-msvc
path: target/x86_64-pc-windows-msvc/release/languagetool-code-comments.exe
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.bin/
.gha/
dist/
dist-gh/
/target
test.ts
completions
Expand Down
13 changes: 5 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ cargo-deny = { version = "0.13.5" }
cargo-gha = { version = "0.4.6" }
cargo-llvm-cov = { version = "0.5.25" }
cargo-nextest = { version = "0.9.57", locked = true }
cargo-xwin = { version = "0.14.8" }
cargo-zigbuild = { version = "0.17.4" }
dprint = { version = "0.40.2" }
git-cliff = { version = "1.3.1" }
rust-script = { version = "0.21.0" }
Expand Down Expand Up @@ -96,6 +94,11 @@ release = '''set -e
cargo bin cargo-deny check licenses
./tools/thirdparty/run.sh
rm -rf dist-gh
mkdir dist-gh
export GH_RUN_ID=$(cargo gha gh run list -R dustinblackman/languagetool-code-comments -w build --json databaseId | jq -rc '.[0].databaseId')
cargo gha gh run download -D dist-gh $GH_RUN_ID
export LTCC_VERSION=$(cat Cargo.toml | grep version | head -n1 | awk -F '"' '{print $2}')
cargo bin git-cliff -o CHANGELOG.md --tag "v$LTCC_VERSION"
cargo bin dprint fmt
Expand All @@ -112,12 +115,6 @@ release = '''set -e
git tag -d "v$LTCC_VERSION"
git tag -a "v$LTCC_VERSION" -m "v$LTCC_VERSION"
./tools/release-env.sh zigbuild --release --target x86_64-apple-darwin
./tools/release-env.sh zigbuild --release --target aarch64-apple-darwin
./tools/release-env.sh zigbuild --release --target x86_64-unknown-linux-gnu
./tools/release-env.sh zigbuild --release --target aarch64-unknown-linux-gnu
./tools/release-env.sh xwin build --release --target x86_64-pc-windows-msvc --xwin-arch x86_64 --xwin-cache-dir .bin/xwin/x86_64
git push
git push --tags
cargo cmd goreleaser
Expand Down
1 change: 0 additions & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[toolchain]
channel = "1.74.0"
components = ["rustfmt", "clippy", "llvm-tools-preview"]
targets = ["x86_64-apple-darwin", "aarch64-apple-darwin", "x86_64-unknown-linux-gnu", "aarch64-unknown-linux-gnu", "x86_64-pc-windows-gnu"]
2 changes: 1 addition & 1 deletion tools/goreleaser-dist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ goTargetToRust() {
rm -rf "./dist/languagetool-code-comments_${target}"
mkdir -p "./dist/languagetool-code-comments_${target}"

rustbin="./target/$(goTargetToRust)/release/languagetool-code-comments"
rustbin="./dist-gh/$(goTargetToRust)/languagetool-code-comments"
if [[ "$target" == "windows_amd64_v1" ]]; then
rustbin="${rustbin}.exe"
fi
Expand Down
13 changes: 0 additions & 13 deletions tools/release-env.sh

This file was deleted.

0 comments on commit 442e59f

Please sign in to comment.