-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch: Separate the workflows to generate release from tags
- Loading branch information
1 parent
5722321
commit 4de544b
Showing
2 changed files
with
54 additions
and
31 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,53 +2,35 @@ name: Release | |
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- "*" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
test: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: '0' | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'oracle' | ||
java-version: '21' | ||
|
||
- name: Run Tests | ||
run: ./gradlew test --no-daemon | ||
|
||
release: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.merge_commit_sha }} | ||
fetch-depth: '0' | ||
|
||
- name: Bump version and push tag | ||
id: version | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
MAJOR_STRING_TOKEN: "major:" | ||
MINOR_STRING_TOKEN: "minor:" | ||
PATCH_STRING_TOKEN: "patch:" | ||
|
||
- name: Set project version for Gradle | ||
run: echo "version='${{ steps.version.outputs.new_tag }}'" >> gradle.properties | ||
- run: echo "version='${{ env.GITHUB_REF_NAME }}'" >> gradle.properties | ||
|
||
- name: Build fat JAR | ||
- name: Build Jar | ||
run: ./gradlew shadowJar --no-daemon | ||
|
||
- uses: marvinpinto/action-automatic-releases@latest | ||
with: | ||
repo_token: "${{ secrets.RELEASE_TOKEN }}" | ||
automatic_release_tag: ${{ steps.version.outputs.new_tag }} | ||
automatic_release_tag: ${{ env.GITHUB_REF_NAME }} | ||
prerelease: false | ||
files: | | ||
build/libs/uk-invitation-letter-${{ steps.version.outputs.new_tag }}.jar | ||
build/libs/uk-invitation-letter-${{ env.GITHUB_REF_NAME }}.jar |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Tag | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'oracle' | ||
java-version: '21' | ||
|
||
- name: Run Tests | ||
run: ./gradlew test --no-daemon | ||
|
||
tag: | ||
needs: test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.merge_commit_sha }} | ||
fetch-depth: '0' | ||
|
||
- name: Bump version and push tag | ||
id: version | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} | ||
MAJOR_STRING_TOKEN: "major:" | ||
MINOR_STRING_TOKEN: "minor:" | ||
PATCH_STRING_TOKEN: "patch:" | ||
WITH_V: true |