Skip to content

Create Tagged Release #27

Create Tagged Release

Create Tagged Release #27

name: "Create Tagged Release"
on:
workflow_dispatch:
inputs:
release_version:
description: 'Version number of the release'
required: true
jobs:
gh_tagged_release:
name: Create tagged release
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ macos-latest, windows-latest, ubuntu-latest ]
steps:
- name: Checkout project
uses: actions/checkout@v3
- name: Setup Git
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Configure Pagefile
if: matrix.os == 'windows-latest'
# Fix for "LINK : fatal error LNK1171: unable to load mspdbcore.dll (error code: 1455)":
# This seems to be caused by running out of memory; increasing page file
# size suggested here:
# https://github.com/actions/virtual-environments/issues/3420#issuecomment-861342418
uses: al-cheb/[email protected]
with:
minimum-size: 16GB
maximum-size: 16GB
disk-root: "C:"
- name: Setup graalvm ce
uses: graalvm/setup-graalvm@v1
with:
version: '22.3.1'
java-version: '17'
components: 'native-image,js'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Cache maven packages
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set versions
if: matrix.os == 'ubuntu-latest'
run: |
release_version=${{ github.event.inputs.release_version }}
release_branch_name=${release_version%.*}.x
echo "release_branch_name=$release_branch_name" >> $GITHUB_ENV
- name: Create Release branch
if: matrix.os == 'ubuntu-latest'
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
git checkout -b ${{ env.release_branch_name }}
git push origin ${{ env.release_branch_name }}
- name: Set maven version
if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest'
run: mvn versions:set -DnewVersion=${{ github.event.inputs.release_version }}
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set maven version on Windows
if: matrix.os == 'windows-latest'
run: mvn versions:set -DnewVersion="${{ github.event.inputs.release_version }}"
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Creating native image (Mac)
if: matrix.os == 'macos-latest'
run: mvn install -P native-image -DskipTests -Dos.platform=mac -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Creating native image (Linux)
if: matrix.os == 'ubuntu-latest'
run: mvn install -P native-image -DskipTests -Dos.platform=linux -Dmaven.wagon.httpconnectionManager.ttlSeconds=60
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Creating native image (Win)
if: matrix.os == 'windows-latest'
run: mvn install -P native-image -DskipTests -D os.platform=win -D maven.wagon.httpconnectionManager.ttlSeconds=60
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create GitHub release (Mac)
if: ${{ (matrix.os == 'macos-latest') && (!contains( github.ref, '-M' )) }}
uses: svenstaro/upload-release-action@latest
with:
file_glob: true
overwrite: true
prerelease: false
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/ame-backend!(*.txt)-mac
tag: v${{ github.event.inputs.release_version }}
- name: Create GitHub pre-release (Mac)
if: ${{ (matrix.os == 'macos-latest') && (contains( github.ref, '-M' )) }}
uses: svenstaro/upload-release-action@latest
with:
file_glob: true
overwrite: true
prerelease: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/ame-backend!(*.txt)-mac
tag: v${{ github.event.inputs.release_version }}
- name: Create GitHub release (Linux)
if: ${{ (matrix.os == 'ubuntu-latest') && (!contains( github.ref, '-M' )) }}
uses: svenstaro/upload-release-action@latest
with:
file_glob: true
overwrite: true
prerelease: false
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/ame-backend!(*.txt)-linux
tag: v${{ github.event.inputs.release_version }}
- name: Create GitHub pre-release (Linux)
if: ${{ (matrix.os == 'ubuntu-latest') && (contains( github.ref, '-M' )) }}
uses: svenstaro/upload-release-action@latest
with:
file_glob: true
overwrite: true
prerelease: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/ame-backend!(*.txt)-linux
tag: v${{ github.event.inputs.release_version }}
- name: Create GitHub release (Windows)
if: ${{ (matrix.os == 'windows-latest') && (!contains( github.ref, '-M' )) }}
uses: svenstaro/upload-release-action@latest
with:
file_glob: true
overwrite: true
prerelease: false
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/ame-backend!(*.txt)-win.exe
tag: v${{ github.event.inputs.release_version }}
- name: Create GitHub pre-release (Windows)
if: ${{ (matrix.os == 'windows-latest') && (contains( github.ref, '-M' )) }}
uses: svenstaro/upload-release-action@latest
with:
file_glob: true
overwrite: true
prerelease: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/ame-backend!(*.txt)-win.exe
tag: v${{ github.event.inputs.release_version }}