Version 1.22.0 #26
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Bridge Release | |
on: | |
release: | |
types: [published] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
release: | |
name: release ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-pc-windows-gnu | |
os: windows-latest | |
extension: ".exe" | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
extension: "" | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
extension: "" | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
extension: "" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- name: Install musl for x86_64-unknown-linux-musl | |
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} | |
run: sudo apt-get install -y musl-dev musl-tools | |
- name: Compile bridge | |
run: cargo build --target ${{ matrix.target }} --release --manifest-path bridge/svix-bridge/Cargo.toml | |
- name: Release | |
uses: actions/upload-artifact@v3 | |
with: | |
name: svix-bridge-${{ matrix.target }} | |
path: bridge/target/${{ matrix.target }}/release/svix-bridge${{ matrix.extension }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
docker: | |
name: release docker | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Login Docker | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Setup Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Derive Version Numbers | |
run: | | |
export REPO="${{ secrets.DOCKERHUB_USERNAME }}/svix-bridge" | |
echo DOCKER_TAGS="$(echo "${{ github.event.release.tag_name }}" | sed -E "s#v([0-9]+)\.([0-9]+)\.([0-9]+)#${REPO}:latest,${REPO}:v\1.\2.\3,${REPO}:v\1.\2,${REPO}:v\1#")" >> "$GITHUB_ENV" | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./bridge | |
file: ./bridge/Dockerfile | |
push: true | |
tags: ${{ env.DOCKER_TAGS }} | |
platforms: linux/amd64,linux/arm64 |