Skip to content

Commit

Permalink
ci: release_workflow.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziedelth committed Aug 27, 2024
1 parent 81e62ef commit ef55193
Showing 1 changed file with 55 additions and 54 deletions.
109 changes: 55 additions & 54 deletions .github/workflows/release_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@ env:
REGISTRY_IMAGE: ${{ vars.DOCKERHUB_USERNAME }}/shikkanime-core

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'corretto'
- name: Build and test
run: ./gradlew clean test --info
# test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Set up JDK ${{ env.JAVA_VERSION }}
# uses: actions/setup-java@v4
# with:
# java-version: ${{ env.JAVA_VERSION }}
# distribution: 'corretto'
# - name: Build and test
# run: ./gradlew clean test --info

upgrade-version:
runs-on: ubuntu-latest
needs: test
# needs: test

outputs:
v-version: ${{ steps.version.outputs.v-version }}
Expand All @@ -39,50 +39,50 @@ jobs:
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: Push changes
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.USER_TOKEN }}
branch: ${{ github.ref }}
force: true

push-tag:
runs-on: ubuntu-latest
needs: upgrade-version

steps:
- uses: actions/checkout@v4

# Pull the latest commits
- name: Pull latest commits
run: git pull

- name: Push Git Tag
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git tag ${{ needs.upgrade-version.outputs.v-version }}
git push origin ${{ needs.upgrade-version.outputs.v-version }}
# - 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: Push changes
# uses: ad-m/[email protected]
# with:
# github_token: ${{ secrets.USER_TOKEN }}
# branch: ${{ github.ref }}
# force: true
#
# push-tag:
# runs-on: ubuntu-latest
# needs: upgrade-version
#
# steps:
# - uses: actions/checkout@v4
#
# # Pull the latest commits
# - name: Pull latest commits
# run: git pull
#
# - name: Push Git Tag
# run: |
# git config user.name "GitHub Actions"
# git config user.email "[email protected]"
# git tag ${{ needs.upgrade-version.outputs.v-version }}
# git push origin ${{ needs.upgrade-version.outputs.v-version }}

docker:
runs-on: ubuntu-latest
needs: [upgrade-version,push-tag]
needs: upgrade-version
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -134,5 +134,6 @@ jobs:
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
load: true
cache-from: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache
cache-to: type=registry,ref=${{ env.REGISTRY_IMAGE }}:buildcache,mode=max
push: true

0 comments on commit ef55193

Please sign in to comment.