Skip to content

Commit

Permalink
revert static-link and build in container
Browse files Browse the repository at this point in the history
  • Loading branch information
sukoneck committed Nov 7, 2024
1 parent 85d8cc4 commit 22adbbe
Showing 1 changed file with 21 additions and 23 deletions.
44 changes: 21 additions & 23 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
needs: extract-version
if: ${{ github.event.inputs.build-binary == 'true' || github.event_name == 'push'}} # when manually triggered or version tagged
runs-on: ${{ matrix.configs.runner }}
container:
image: ubuntu:22.04
env:
VERSION: ${{ needs.extract-version.outputs.VERSION }}
permissions:
Expand All @@ -59,39 +61,35 @@ jobs:
strategy:
matrix:
configs:
- target: x86_64-unknown-linux-musl
- target: x86_64-unknown-linux-gnu
runner: warp-ubuntu-latest-x64-16x

steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Run WarpBuilds/rust-cache
uses: WarpBuilds/rust-cache@v2
with:
cache-on-failure: true
- uses: actions/checkout@v4

- name: Prepare output filename
run: |
OUTPUT_FILENAME="rbuilder-${VERSION}-${{ matrix.configs.target }}.tar.gz"
echo "OUTPUT_FILENAME=$OUTPUT_FILENAME" >> $GITHUB_ENV
echo "Filename: ${OUTPUT_FILENAME}"
- uses: WarpBuilds/rust-cache@v2

- uses: taiki-e/install-action@cross
- name: Prepare filename
run: echo "OUTPUT_FILENAME=rbuilder-${VERSION}-${{ matrix.configs.target }}" >> $GITHUB_ENV

- name: Build binary
run: cross build --release --target ${{ matrix.configs.target }}

- name: Prepare artifacts
run: |
mkdir -p artifacts
tar -czf "artifacts/${OUTPUT_FILENAME}" -C target/${{ matrix.configs.target }}/release rbuilder
- name: Upload artifacts
uses: actions/[email protected]
apt-get update
apt-get install -y \
curl \
build-essential \
pkg-config \
libssl-dev \
protobuf-compiler
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. $HOME/.cargo/env
cargo build --release --target ${{ matrix.configs.target }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.OUTPUT_FILENAME }}
path: artifacts/${{ env.OUTPUT_FILENAME }}
path: target/${{ matrix.configs.target }}/release/rbuilder

draft-release:
name: Draft release
Expand Down

0 comments on commit 22adbbe

Please sign in to comment.