Merge pull request #143 from digitalresistor/dependabot/cargo/clap-4.4.2 #61
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
on: | |
# Only on pushes to master or one of the release branches we build on push | |
push: | |
branches: | |
- main | |
tags: | |
- '**' | |
name: Cross Build | |
jobs: | |
cross: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- aarch64-unknown-linux-musl | |
- armv7-unknown-linux-musleabihf | |
- i686-unknown-linux-musl | |
- x86_64-unknown-linux-musl | |
name: ${{ matrix.target }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
override: true | |
- uses: actions-rs/cargo@v1 | |
with: | |
use-cross: true | |
command: build | |
args: --release --target=${{ matrix.target }} | |
- name: Archive barnacle binary | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.target }} | |
path: | | |
target/${{ matrix.target }}/release/barnacle | |
docker: | |
runs-on: ubuntu-latest | |
needs: cross | |
name: Build Docker Containers | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v3 | |
with: | |
path: ci/docker/artifacts/ | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
# list of Docker images to use as base name for tags | |
images: | | |
${{ secrets.DOCKER_USERNAME }}/barnacle | |
# generate Docker tags based on the following events/attributes | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
type=edge,branch=main | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Login to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build docker containers | |
uses: docker/build-push-action@v4 | |
with: | |
context: ci/docker/ | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/amd64,linux/386,linux/arm64,linux/arm/v7 |