Skip to content

Commit

Permalink
refactor(ci): separate release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
lgdd committed Apr 16, 2024
1 parent 030311d commit 964972d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 22 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

name: Release Please

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
30 changes: 8 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@
on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write
release:
types: [published]

name: Release

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
upload-release:
needs: release-please
if: needs.release-please.outputs.release_created
upload-jar:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -30,12 +18,11 @@ jobs:
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.release-please.outputs.tag_name }} $(ls target/*-runner.jar)
gh release upload ${{ github.event.release.name }} $(ls target/*-runner.jar)
push-java-docker-image:
needs: release-please
if: needs.release-please.outputs.release_created
runs-on: ubuntu-latest
steps:
- run: echo "APP_VERSION=$(${{ github.event.release.name }} | cut -d'v' -f 2)" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -51,12 +38,11 @@ jobs:
with:
file: Dockerfile.jvm
push: true
tags: lgdd/liferay-starter:latest-jvm,lgdd/liferay-starter:${{ needs.release-please.outputs.major }}.${{ needs.release-please.outputs.minor }}.${{ needs.release-please.outputs.patch }}-jvm
tags: lgdd/liferay-starter:latest-jvm,lgdd/liferay-starter:$APP_VERSION-jvm
push-native-docker-image:
needs: release-please
if: needs.release-please.outputs.release_created
runs-on: ubuntu-latest
steps:
- run: echo "APP_VERSION=$(${{ github.event.release.name }} | cut -d'v' -f 2)" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -72,4 +58,4 @@ jobs:
with:
file: Dockerfile.native
push: true
tags: lgdd/liferay-starter:latest,lgdd/liferay-starter:${{ needs.release-please.outputs.major }}.${{ needs.release-please.outputs.minor }}.${{ needs.release-please.outputs.patch }}
tags: lgdd/liferay-starter:latest,lgdd/liferay-starter:$APP_VERSION

0 comments on commit 964972d

Please sign in to comment.