Skip to content

Commit

Permalink
Add workflows for publishing release binaries and container images
Browse files Browse the repository at this point in the history
  • Loading branch information
TheiLLeniumStudios committed Jan 14, 2024
1 parent 430f7dd commit 945d1b7
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Create Release
on:
push:
tags:
- 'v*'
jobs:
create_release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: ncipollo/release-action@v1
20 changes: 20 additions & 0 deletions .github/workflows/publish-binaries.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish binaries to release
on:
release:
types: [created]
jobs:
release:
name: release ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [x86_64-pc-windows-gnu, x86_64-unknown-linux-musl]
steps:
- uses: actions/checkout@v4
- name: Compile and release
uses: rust-build/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
31 changes: 31 additions & 0 deletions .github/workflows/publish-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Docker image
on:
release:
types: [published]
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels)
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 945d1b7

Please sign in to comment.