This repository has been archived by the owner on Mar 20, 2024. It is now read-only.
added auto correction of pom version in the tag and release action #9
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 installer | ||
on: | ||
push: | ||
tags: | ||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
permissions: | ||
contents: write | ||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Correct pom version as per tag name | ||
uses: jacobtomlinson/gha-find-replace@v3 | ||
with: | ||
find: "(<artifactId>asa_sm<\/artifactId>(?:\s)*<version>)\d+\.\d+\.\d+(?:-SNAPSHOT)?(<\/version>)" | ||
replace: ${{ format('$1{0}$2', github.ref_name) }} | ||
include: "pom.xml" | ||
- name: Configure application-prod.properties | ||
run: | | ||
python -c "import os; file = open('src/main/resources/application-prod.properties', 'w'); file.write(os.environ['APPLICATION_PROD_PROPERTIES']); file.close()" | ||
env: | ||
APPLICATION_PROD_PROPERTIES : ${{secrets.APPLICATION_PROD_PROPERTIES}} | ||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml -Pprod | ||
- name: Building the installer | ||
run: | | ||
cd innosetup | ||
"%programfiles(x86)%\Inno Setup 6\iscc.exe" "script.iss" | ||
shell: cmd | ||
- uses: ncipollo/[email protected] | ||
with: | ||
artifacts: "innosetup/Output/*.exe" | ||
prerelease: true | ||
generateReleaseNotes: true |