Release workflow #274
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 workflow | |
on: | |
workflow_dispatch: # Allows manual triggering | |
env: | |
JAVA_VERSION: 21 | |
REGISTRY_IMAGE: registry.shikkanime.fr:5000/shikkanime-core | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
fetch-depth: 0 | |
- name: Set up JDK ${{ env.JAVA_VERSION }} | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: 'corretto' | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: registry.shikkanime.fr:5000 | |
username: ziedelth | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Get next version | |
uses: reecetech/[email protected] | |
id: version | |
with: | |
scheme: conventional_commits | |
- name: Update version in build.gradle.kts | |
run: | | |
#!/bin/bash | |
PROJECT_VERSION=$(cat 'build.gradle.kts' | grep -oP 'version = "\K[^\\"]*' | head -n 1) | |
# Update the file | |
sed -i "s|$PROJECT_VERSION|${{ steps.version.outputs.version }}|g" build.gradle.kts | |
# Set up Git | |
git config user.name Ziedelth | |
git config user.email ${{ secrets.USER_EMAIL }} | |
# Commit the changes | |
git add build.gradle.kts | |
git commit -m "Update version to ${{ steps.version.outputs.version }}" | |
- name: Build | |
run: gradle clean installDist | |
- name: Build docker file | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
push: true | |
tags: ${{ env.REGISTRY_IMAGE }}:latest,${{ env.REGISTRY_IMAGE }}:${{ steps.version.outputs.v-version }} | |
platforms: linux/arm64/v8 | |
cache-from: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache | |
cache-to: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.USER_TOKEN }} | |
branch: ${{ github.ref }} | |
force: true | |
- name: Push Git Tag | |
run: | | |
git config user.name Ziedelth | |
git config user.email ${{ secrets.USER_EMAIL }} | |
git tag ${{ steps.version.outputs.v-version }} | |
git push origin ${{ steps.version.outputs.v-version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.USER_TOKEN }} |