Create Release #52
Workflow file for this run
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: Create Release | |
on: | |
push: | |
branches-ignore: | |
- '**' | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+' | |
jobs: | |
build-binaries: | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
matrix: | |
os: [ windows-latest, ubuntu-latest ] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Setup Poetry | |
uses: abatilo/[email protected] | |
with: | |
poetry-version: 1.3.2 | |
- name: Get version tag | |
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Install Linux dependencies | |
if: ${{ runner.os == 'Linux' }} | |
run: > | |
sudo apt-get install | |
'^libxcb.*-dev' | |
libx11-xcb-dev | |
libglu1-mesa-dev | |
libxrender-dev | |
libxi-dev | |
libxkbcommon-dev | |
libxkbcommon-x11-dev | |
- name: Install dependencies | |
run: | | |
poetry version ${{ env.tag }} | |
sed -i "s/0.0.0/${{ env.tag }}/g" las_trx/__init__.py | |
poetry run pip install --upgrade pip setuptools | |
poetry install | |
- name: Build Linux GUI Executable | |
if: ${{ runner.os == 'Linux' }} | |
run: > | |
poetry run pyinstaller | |
--onefile | |
--icon="las_trx/resources/las-trx.ico" | |
--add-data="las_trx/resources/las-trx.ico:resources" | |
--add-data="las_trx/resources/*.ui:resources" | |
--name LAS-TRX-v${{ env.tag }}-linux | |
las_trx/__main__.py | |
- name: Build Windows GUI Executable | |
if: ${{ runner.os == 'Windows' }} | |
run: > | |
poetry run pyinstaller | |
--onefile | |
--windowed | |
--icon="las_trx\resources\las-trx.ico" | |
--add-data="las_trx\resources\las-trx.ico;resources" | |
--add-data="las_trx\resources\*.ui;resources" | |
--name LAS-TRX-v${{ env.tag }}-win64.exe | |
las_trx/__main__.py | |
- name: Archive release artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.os }}-dist | |
path: dist | |
create-release: | |
needs: build-binaries | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get tag | |
id: tag | |
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Detect prerelease | |
id: prerelease | |
run: | | |
if echo ${{ env.tag }} | grep -qe '?*.*.*rc*'; then | |
echo "prerelease=true" >> $GITHUB_ENV | |
else | |
echo "prerelease=false" >> $GITHUB_ENV | |
fi | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag: ${{ env.tag }} | |
draft: true | |
prerelease: ${{ env.prerelease }} | |
artifacts: "artifacts/windows-latest-dist/*,artifacts/ubuntu-latest-dist/*" | |
artifactContentType: application/octet-stream | |
generateReleaseNotes: true |