Force latest image for all targets #677
Workflow file for this run
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: Release | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: | |
- sopell/musl-builds | |
tags: | |
- v[0-9]+.* | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Create GitHub release | |
uses: taiki-e/create-gh-release-action@v1 | |
with: | |
changelog: CHANGELOG.md | |
token: ${{ secrets.GITHUB_TOKEN }} | |
upload-binaries: | |
strategy: | |
matrix: | |
include: | |
# Linux Aarch64 cross build. | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-20.04 | |
cc: 'aarch64-linux-gnu-gcc' | |
cxx: 'aarch64-linux-gnu-g++' | |
# Mac M1 cross build. Uses protobuf compiler on the host. | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
cflags: '-target arm64-apple-macos' | |
cxxflags: '-target arm64-apple-macos' | |
cc: 'clang' | |
cxx: 'clang++' | |
# Normal x86-64 Linux build | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-20.04 | |
# Musl x86-64 | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-20.04 | |
# Musl aarch64 | |
- target: aarch64-unknown-linux-musl | |
os: ubuntu-20.04 | |
# Normal Intel Mac build | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
# Try to complete every job in the matrix, even if one fails. | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: taiki-e/install-action@v2 | |
with: | |
tool: cross | |
- name: Install protobuf (Apt) | |
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
if: matrix.os == 'ubuntu-20.04' | |
- name: Install protobuf (Brew) | |
run: brew install protobuf | |
if: matrix.os == 'macos-latest' | |
- name: Check protobuf | |
run: protoc --version; which protoc; echo "PROTOC IS ${PROTOC}"; | |
# Run the build & upload artifacts | |
- name: Build and upload lading binaries | |
uses: taiki-e/upload-rust-binary-action@v1 | |
env: | |
# Setting CFLAGS or CXXFLAGS will override the default flags provided by the cc crate | |
CFLAGS: ${{ matrix.cflags }} | |
CXXFLAGS: ${{ matrix.cxxflags }} | |
CC: ${{ matrix.cc }} | |
CXX: ${{ matrix.cxx }} | |
with: | |
bin: lading | |
no_default_features: true | |
features: ${{ matrix.features || '' }} | |
target: ${{ matrix.target }} | |
checksum: sha256 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
dry_run: true | |
# Auth for the S3 upload | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1-node16 | |
with: | |
aws-access-key-id: ${{ secrets.LADING_RELEASE_BOT_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.LADING_RELEASE_BOT_SECRET_ACCESS_KEY }} | |
aws-region: us-west-2 | |
# Copy from cargo target directory to S3 release bucket | |
- name: Upload binary to S3 | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: | | |
aws s3 cp target/${{ matrix.target }}/release/lading s3://lading-releases/${{ github.ref_name }}/${{ matrix.target }}/lading | |
crates-io-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install protobuf | |
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
- name: Publish to crates.io | |
run: | | |
cargo publish \ | |
--token ${{ secrets.CARGO_REGISTRY_TOKEN }} \ | |
--locked \ | |
--package lading-capture | |
cargo publish \ | |
--token ${{ secrets.CARGO_REGISTRY_TOKEN }} \ | |
--locked \ | |
--package lading |