Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
james58899 committed Jan 30, 2024
1 parent 7d0137f commit 0bf3b4a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 18 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,25 @@ jobs:
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer
- name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3
with:
cosign-release: 'v1.13.1'

- name: Setup QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
Expand All @@ -55,15 +53,15 @@ jobs:
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ jobs:
CFLAGS: "-flto -fuse-ld=lld-17"
CXXFLAGS: "-flto -fuse-ld=lld-17"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install build tools
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 17
sudo apt-get install -y crossbuild-essential-arm64
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -45,7 +45,7 @@ jobs:
CARGO_HOST_RUSTFLAGS: "-Clink-arg=-fuse-ld=lld-17"
CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-17 -Clink-arg=-fuse-ld=lld-17 -Clink-arg=--target=x86_64-unknown-linux-gnu"
run: cargo +nightly -Ztarget-applies-to-host -Zhost-config build --verbose --release --target=x86_64-unknown-linux-gnu
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: hath-rust-x86_64
path: target/x86_64-unknown-linux-gnu/release/hath-rust
Expand All @@ -55,15 +55,15 @@ jobs:
CARGO_HOST_RUSTFLAGS: "-Clink-arg=-fuse-ld=lld-17"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-Clinker-plugin-lto -Clinker=clang-17 -Clink-arg=-fuse-ld=lld-17 -Clink-arg=--target=aarch64-unknown-linux-gnu"
run: cargo +nightly -Ztarget-applies-to-host -Zhost-config build --verbose --release --target=aarch64-unknown-linux-gnu
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: hath-rust-aarch64
path: target/aarch64-unknown-linux-gnu/release/hath-rust
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -74,15 +74,15 @@ jobs:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --verbose --release
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: hath-rust-windows
path: target/release/hath-rust.exe
build-macos:
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
Expand All @@ -101,7 +101,7 @@ jobs:
run: cargo build --verbose --release --target aarch64-apple-darwin
- name: Universal binary
run: lipo -create target/x86_64-apple-darwin/release/hath-rust target/aarch64-apple-darwin/release/hath-rust -output target/release/hath-rust
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: hath-rust-macos
path: target/release/hath-rust

0 comments on commit 0bf3b4a

Please sign in to comment.