[tag] publish release #1
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
# | ||
# workflow for releases | ||
# triggered when a tag with a semantic version is pushed | ||
# builds release binaries and drafts a release | ||
# | ||
name: '[tag] publish release' | ||
on: | ||
push: | ||
tags: | ||
- "v[0-9]+.[0-9]+.[0-9]+" | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: The tag name to run this workflow for | ||
required: true | ||
type: string | ||
jobs: | ||
draftRelease: | ||
name: Draft github release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
version: ${{ steps.get-version.outputs.version }} | ||
steps: | ||
- name: Get version (from dispatch) | ||
id: get-version | ||
if: inputs.tag != '' | ||
run: echo "::set-output name=version::${{ inputs.tag }}" | ||
- name: Get version (from pushed tag) | ||
if: steps.get-version.conclusion == 'skipped' | ||
run: echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}" | ||
- name: Draft release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body: | | ||
Make sure to test each package before publishing this draft. | ||
If all is good, replace this text with the changelog and publish. | ||
If a build failed for a platform or there's an issue with any of the | ||
packages, delete this draft and the tag and try again after making | ||
any necessary fixes. | ||
DELETE ABOVE THIS LINE | ||
======================================================= | ||
Disclaimer: The MacOS builds are untested and are not guaranteed to | ||
work. They **should** work exactly like the Linux and Windows builds. | ||
Use at your own risk and please report any problems to issues. | ||
draft: true | ||
name: Trackerboy ${{ steps.get-version.outputs.version }} | ||
prerelease: ${{ startsWith( 'v0.', steps.get-version.outputs.version ) }} | ||
release: | ||
name: Release ${{ matrix.arch }}-${{ matrix.platform }} | ||
needs: draft-release | ||
Check failure on line 59 in .github/workflows/buildRelease.yml
|
||
runs-on: ${{ matrix.os }} | ||
outputs: | ||
asset-location: ${{ steps.archive.outputs.filename }} | ||
asset-name: ${{ matrix.platform }}-${{ matrix.arch }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
arch: x64 | ||
platform: osx | ||
qt-arch: '' | ||
- os: ubuntu-18.04 | ||
arch: x64 | ||
platform: linux | ||
qt-arch: '' | ||
- os: windows-latest | ||
arch: x86 | ||
platform: windows | ||
qt-arch: win32_msvc2019 | ||
- os: windows-latest | ||
arch: x64 | ||
platform: windows | ||
qt-arch: win64_msvc2019_64 | ||
env: | ||
QT_VERSION: 5.15.2 | ||
TRIPLET: ${{ matrix.arch }}-${{ matrix.platform }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Install dependencies (Linux) | ||
if: ${{ runner.os == 'Linux'}} | ||
run: ${{ github.workspace }}/.github/scripts/linuxdeps.sh "${{ github.workspace }}/tools" | ||
- uses: lukka/get-cmake@latest | ||
- uses: ilammy/msvc-dev-cmd@v1 | ||
with: | ||
arch: ${{ matrix.arch }} | ||
- name: Cache Qt | ||
id: cache-qt | ||
uses: actions/cache@v1 | ||
with: | ||
path: ../Qt | ||
key: ${{ matrix.os }}-${{ matrix.arch }}-${{ env.QT_VERSION }}-QtCache | ||
- name: Install Qt | ||
uses: jurplel/install-qt-action@v2 | ||
with: | ||
py7zrversion: ==0.16.2 # workaround for windows-x86 | ||
version: ${{ env.QT_VERSION }} | ||
arch: ${{ matrix.qt-arch }} | ||
cached: ${{ steps.cache-qt.outputs.cache-hit }} | ||
- name: Build | ||
run: | | ||
cmake -S . -B build -GNinja -DCMAKE_BUILD_TYPE=MinSizeRel -DENABLE_UNITY=ON -DENABLE_DEPLOYMENT=ON | ||
cmake --build build --target deploy | ||
# windows and macos get a zip of the deploy folder | ||
# linux gets a tarball | ||
# both archives will have the following naming scheme: | ||
# trackerboy-[version]-[arch]-[platform].[zip|tar.gz] | ||
# examples: | ||
# trackerboy-v0.5.0-x64-windows.zip | ||
# trackerboy-v0.5.0-x86-windows.zip | ||
# trackerboy-v0.5.0-x64-linux.tar.gz | ||
# trackerboy-v0.5.0-x64-osx.zip | ||
- name: determine archive format | ||
id: archive | ||
shell: bash | ||
run: | | ||
if [ '${{ runner.os }}' == 'Linux' ]; then | ||
echo "::set-output name=format::tar" | ||
EXT="tar.gz" | ||
else | ||
echo "::set-output name=format::zip" | ||
EXT="zip" | ||
fi | ||
echo "::set-output name=filename::trackerboy-${{ needs.draft-release.outputs.version }}-${{ env.TRIPLET }}.$EXT" | ||
- name: Packaging | ||
uses: thedoctor0/zip-release@master | ||
with: | ||
type: ${{ steps.archive.outputs.format }} | ||
filename: ../${{ steps.archive.outputs.filename }} | ||
directory: ${{ github.workspace }}/build/src/deploy | ||
- name: Upload package to release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: true | ||
files: ${{ github.workspace }}/build/src/${{ steps.archive.outputs.filename }} | ||
# Builds an offline version of the manual to include in the release, as a | ||
# separate download | ||
docs: | ||
name: Documentation | ||
needs: draft-release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- name: Get mkdocs | ||
run: ${{ github.workspace }}/.github/scripts/getmkdocs.sh | ||
- name: Build manual | ||
run: | | ||
mkdocs build --no-directory-urls -d build/manual | ||
- name: Package | ||
run: | | ||
cd build | ||
zip -r manual.zip manual | ||
- name: Upload to release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: true | ||
files: ${{ github.workspace }}/build/manual.zip | ||
publish: | ||
name: Publish release to www.trackerboy.org | ||
needs: [docs, release] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout trackerboy.org repo | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: TrackerboyOrg/TrackerboyOrg.github.io | ||
token: ${{ secrets.TRACKERBOY_SITE_PAT }} | ||
path: ./site | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: add release | ||
working-directory: ./site | ||
run: ./ci.py release |