Release v0.1.0 #25
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 | |
run-name: Release ${{ inputs.version || github.ref_name }} | |
on: | |
push: | |
tags: | |
- v* | |
workflow_dispatch: | |
inputs: | |
version: | |
required: true | |
type: string | |
description: Version (vX.X.X) | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
env: | |
VERSION: ${{ inputs.version || github.ref_name }} | |
RELEASE_ZIP_FILENAME: ${{ github.event.repository.name }}-${{ inputs.version || github.ref_name }}.zip | |
DOCKER_IMAGE_NAME: ghcr.io/${{ github.actor }}/${{ github.event.repository.name }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Create release ZIP file | |
run: zip -r $RELEASE_ZIP_FILENAME . -x /.git/* -x /.github/* -x /.dockerignore -x /Dockerfile | |
- name: Delete existing GitHub release, if any | |
env: | |
GH_TOKEN: ${{ github.token }} | |
GH_REPO: ${{ github.repository }} | |
run: gh release delete $VERSION --cleanup-tag --yes || true | |
- name: Release on GitHub | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | |
with: | |
tag_name: ${{ env.VERSION }} | |
generate_release_notes: true | |
files: ${{ env.RELEASE_ZIP_FILENAME }} | |
- name: Delete release ZIP file | |
run: rm $RELEASE_ZIP_FILENAME | |
- name: Sign into GitHub Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64 | |
push: true | |
provenance: false | |
tags: ${{ env.DOCKER_IMAGE_NAME }}:${{ env.VERSION }},${{ env.DOCKER_IMAGE_NAME }}:latest |