Skip to content

Merge pull request #5 from sgcr/feature/merge-from-release-8-test-2 #14

Merge pull request #5 from sgcr/feature/merge-from-release-8-test-2

Merge pull request #5 from sgcr/feature/merge-from-release-8-test-2 #14

Workflow file for this run

name: Automated DEV Release
on:
push:
branches:
- "master"
- "release/**"
jobs:
release-dev:
runs-on: ubuntu-latest
permissions:
contents: write
discussions: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v2
- name: Download and install install4j
run: wget https://download-gcdn.ej-technologies.com/install4j/install4j_linux-x64_10_0_6.deb && sudo dpkg -i install4j_linux-x64_10_0_6.deb
- name: Build with Gradle
run: ./gradlew release
env:
INSTALL4J_HOME: /opt/install4j10
INSTALL4J_LICENSE: ${{ secrets.INSTALL4J_LICENSE }}
POEDITOR_APIKEY: ${{ secrets.POEDITOR_APIKEY }}
RUN_NUMBER: ${{ github.run_number }}
RELEASE_ARTEFACTS: true
- name: Read version properties
id: read_version_properties
uses: christian-draeger/[email protected]
with:
path: 'version.properties'
properties: 'version shortVersion tag branch'
- name: Show version
id: show_version
run: cat version.properties
- name: Delete previous tag and release
uses: tychobrailleur/delete-tag-and-release@453626e2f16a2625a19e18d91e4cdf1f41624dde
with:
delete_release: true
delete_non_draft: true
tag_name: ${{ steps.read_version_properties.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: Create a Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
files: |
build/artefacts/**
name: ${{ steps.read_version_properties.outputs.version }}
tag_name: ${{ steps.read_version_properties.outputs.tag }}
body_path: docs/md/release_notes.md
target_commitish: ${{ steps.read_version_properties.outputs.branch }}
prerelease: true
# Well, yuck... but hopefully this does the trick:
- name: Publish Release
run: |
curl --request PATCH \
--header 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'Content-type: application/json' \
--header 'User-Agent: Github-Action' \
--url https://api.github.com/repos/ho-dev/HattrickOrganizer/releases/${{ steps.create_release.outputs.id }} \
--data '{ "draft": false }'
- name: If not dev-release delete previous short version tag
if: ${{ steps.read_version_properties.outputs.tag != 'dev' }}
uses: tychobrailleur/delete-tag-and-release@453626e2f16a2625a19e18d91e4cdf1f41624dde
with:
delete_release: true
delete_non_draft: true
tag_name: ${{ steps.read_version_properties.outputs.shortVersion }}
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: If not dev-release create a Release with short version tag
if: ${{ steps.read_version_properties.outputs.tag != 'dev' }}
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
files: |
build/artefacts/**
name: ${{ steps.read_version_properties.outputs.version }}
tag_name: ${{ steps.read_version_properties.outputs.shortVersion }}
body_path: docs/md/release_notes.md
target_commitish: ${{ steps.read_version_properties.outputs.branch }}
prerelease: ${{ steps.read_version_properties.outputs.tag != 'tag_stable' }}
- name: Create `stable` release if `tag_stable` release
if: ${{ steps.read_version_properties.outputs.tag == 'tag_stable' }}
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
with:
files: |
build/artefacts/**
name: ${{ steps.read_version_properties.outputs.version }}
tag_name: stable
body_path: docs/md/release_notes.md
target_commitish: ${{ steps.read_version_properties.outputs.branch }}
prerelease: false