Skip to content

⚡ Sync workflows with template #4

⚡ Sync workflows with template

⚡ Sync workflows with template #4

name: (Auto) Create release
on:
pull_request:
types: [closed]
push:
branches:
- release/**
permissions:
contents: write
packages: write
jobs:
release:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/')
name: Create Release
runs-on: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Install Task
uses: arduino/[email protected]
with:
version: 3.x
- name: Create and push git tags
id: version
env:
VERSION_SUFFIX: ""
run: |
task lint
task git:set-config
task version:tag-release
echo "REL_VERSION=$(task version:get)" >> "$GITHUB_OUTPUT"
- name: Install Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Install QEMU
uses: docker/setup-qemu-action@v3
with:
image: tonistiigi/binfmt:latest
platforms: amd64,arm64
- name: Get Docker commands
env:
VERSION_SUFFIX: ""
run: task docker:cmds
- name: Build and Push
env:
DOCKER_TOKEN: ${{ secrets.DOCKER_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION_SUFFIX: ""
run: task docker:push
- name: Inspect image
env:
VERSION_SUFFIX: ""
run: task docker:push:inspect
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.REL_VERSION }}
name: ${{ steps.version.outputs.REL_VERSION }}
draft: false
prerelease: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Docker hub description
uses: peter-evans/dockerhub-description@v5
with:
username: ${{ vars.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
repository: ${{ vars.DOCKER_ORG_NAME }}/${{ github.event.repository.name }}
short-description: ${{ github.event.repository.description }}