Release Pipeline #7
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 Pipeline | |
on: | |
release: | |
types: [published] | |
jobs: | |
run_build: | |
name: Build for ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
file-suffix: "" | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
file-suffix: "" | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: nightly | |
target: ${{ matrix.target }} | |
override: true | |
- if: runner.os == 'Linux' | |
run: sudo apt install -y libvncserver-dev | |
- if: runner.os == 'macOS' | |
run: brew install libvncserver | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --target=${{ matrix.target }} | |
- name: Rename binary file | |
run: mv target/${{ matrix.target }}/release/breakwater${{ matrix.file-suffix }} breakwater-${{ matrix.target }}${{ matrix.file-suffix }} | |
- name: Upload Release binaries | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: breakwater-${{ matrix.target }}${{ matrix.file-suffix }} | |
push_docker_image: | |
name: Push Docker image to Docker Hub | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 | |
with: | |
images: sbernauer/breakwater | |
- name: Build and push Docker image | |
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc | |
with: | |
context: . | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |