Skip to content

Commit

Permalink
Build binaries on release
Browse files Browse the repository at this point in the history
  • Loading branch information
m1guelpf committed Jul 24, 2024
1 parent b582037 commit 6c80d78
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ jobs:
tags: |
type=sha
type=edge
type=semver,pattern={{major}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: Release

on:
release:
types: [published]

permissions:
contents: read
packages: write

jobs:
docker:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- image: orbit-server
dockerfile: ./Dockerfile.server
- image: orbit-cli
dockerfile: ./Dockerfile.cli
steps:
- uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/m1guelpf/${{ matrix.image }}
tags: |
type=semver,pattern={{major}}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: '${{ github.actor }}'
password: '${{ secrets.GITHUB_TOKEN }}'

- name: Build and push
id: docker_build
uses: docker/build-push-action@v6
with:
push: true
context: .
cache-from: type=gha
cache-to: 'type=gha,mode=max'
file: '${{ matrix.dockerfile }}'
tags: '${{ steps.meta.outputs.tags }}'
labels: '${{ steps.meta.outputs.labels }}'
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false

binaries:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: x86_64-unknown-linux-musl

- name: Build
run: cargo build --release --bins

- name: Upload orbit-server binary
uses: shogo82148/actions-upload-release-asset@v1
with:
asset_path: target/release/orbit-server
upload_url: ${{ github.event.release.upload_url }}

- name: Upload orbit-cli binary
uses: shogo82148/actions-upload-release-asset@v1
with:
asset_path: target/release/orbit-cli
upload_url: ${{ github.event.release.upload_url }}

0 comments on commit 6c80d78

Please sign in to comment.