Release (version 0.6.1-rc1, draft true) [workflow_dispatch][dev-0.6.1] #70
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
test_release: | |
description: 'Draft Release' | |
required: true | |
type: boolean | |
default: true | |
version_tag: | |
description: 'Version tag' | |
type: 'string' | |
required: true | |
default: '0.6.1' | |
run-name: Release (version ${{ inputs.version_tag }}, draft ${{ inputs.test_release }}) [${{ github.event_name }}][${{ github.head_ref || github.ref_name }}] | |
jobs: | |
check-release-tag: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
show-progress: true | |
- name: Check tag | |
uses: mukunku/[email protected] | |
id: checkTag | |
with: | |
tag: 'v${{ github.event.inputs.version_tag }}' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- if: ${{ steps.checkTag.outputs.exists == 'true' }} | |
name: Fail build | |
run: exit 1 | |
- name: Prepare Changelog | |
if: ${{ steps.checkTag.outputs.exists == 'false' }} | |
id: changelog | |
run: | | |
PREV_TAG=$(git tag | grep -E "^v" | sort -ud | tac | head -n1) | |
echo "== Features ==" > changelog.txt | |
git log ${PREV_TAG}..HEAD --pretty=format:"%s" | uniq | grep -E "^feat" >> changelog.txt | |
echo "" >> changelog.txt | |
echo "== Fix ==" >> changelog.txt | |
git log ${PREV_TAG}..HEAD --pretty=format:"%s" | uniq | grep -E "^bug|^fix" >> changelog.txt | |
- name: Upload Changelog | |
uses: actions/upload-artifact@v4 | |
if: ${{ steps.checkTag.outputs.exists == 'false' }} | |
with: | |
name: changelog_v${{ github.event.inputs.version_tag }} | |
path: changelog.txt | |
user-manual: | |
needs: check-release-tag | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
env: | |
GO_VERSION: 1.20.14 | |
PANDOC_VERSION: 3.3 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
clean: true | |
submodules: false | |
- name: Install Pandoc | |
uses: pandoc/actions/[email protected] | |
with: | |
version: ${{ env.PANDOC_VERSION }} | |
- name: Install TeXlive | |
run: sudo apt-get update && sudo apt-get install texlive-full | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Generate PDF | |
run: | | |
cd docs/ | |
CURDATE=$(date '+%x %T') | |
sed -i -E -e 's|subtitle:.+|subtitle: "User Manual - version ${{ github.event.inputs.version_tag }}"|' -e "s|date:.+|date: \"$CURDATE\"|" user-manual.md | |
sed -i -E -e 's|page-background:\s*resources/draft.png||' user-manual.md | |
go generate | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: qpep_user_manual_v${{ github.event.inputs.version_tag }} | |
path: "docs/*.pdf" | |
- name: Auto-cancel workflow on error | |
if: failure() | |
uses: andymckay/[email protected] | |
build-mac-os: | |
needs: check-release-tag | |
runs-on: macos-latest | |
env: | |
GO_VERSION: 1.20.14 | |
CMAKE_VERSION: '3.22.x' | |
GOARCH: arm64 | |
GOOS: darwin | |
CGO_ENABLED: 1 | |
GOPATH: ${{ github.workspace }}/.go | |
CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
IGNORE_PACKAGES: 'tray|docker|docs|version|webgui|workers$' | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
clean: true | |
submodules: true | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Set up CMake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: ${{ env.CMAKE_VERSION }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Prepare | |
run: | | |
go clean -cache -x | |
mkdir -p $GOPATH/bin | |
pip install dmgbuild | |
- name: Build Backends | |
run: | | |
export CPP=${CXX} | |
export PATH=$GOPATH/bin:$GOPATH/bin/${GOOS}_${GOARCH}:$PATH | |
cd backend/ | |
go generate | |
- name: Build Executable | |
run: | | |
go build -v -o build/qpep | |
- name: Build QPep Tray 64bits | |
run: | | |
pushd qpep-tray | |
go build -v -o ../build/qpep-tray | |
popd | |
- name: Build MacOS installer | |
run: | | |
bash ./installer_osx.sh "${{ github.event.inputs.version_tag }}" | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: qpep_macos_v${{ github.event.inputs.version_tag }} | |
path: installer-osx/QPep*.pkg | |
- name: Auto-cancel workflow on error | |
if: failure() | |
uses: andymckay/[email protected] | |
build-linux: | |
needs: check-release-tag | |
runs-on: ubuntu-latest | |
env: | |
GO_VERSION: 1.20.14 | |
CMAKE_VERSION: '3.22.x' | |
GOARCH: amd64 | |
GOOS: linux | |
CGO_ENABLED: 1 | |
CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
IGNORE_PACKAGES: 'tray|docker|docs|version|webgui' | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
clean: true | |
submodules: true | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Set up CMake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: ${{ env.CMAKE_VERSION }} | |
- name: Prepare | |
run: | | |
sudo apt-get install -y pkg-config libgtk-3-dev libayatana-appindicator-dev | |
go clean -cache -x | |
- name: Build Backends | |
run: | | |
cd backend/ | |
go generate | |
- name: Build QPep | |
run: | | |
go build -v -o build/qpep | |
- name: Build QPep Tray | |
run: | | |
pushd qpep-tray | |
go build -o ../build/qpep-tray | |
popd | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: qpep_linux_v${{ github.event.inputs.version_tag }} | |
path: build/ | |
- name: Auto-cancel workflow on error | |
if: failure() | |
uses: andymckay/[email protected] | |
build-windows: | |
needs: check-release-tag | |
runs-on: windows-latest | |
env: | |
GO_VERSION: 1.20.14 | |
CMAKE_VERSION: '3.22.x' | |
GOARCH: amd64 | |
GOOS: windows | |
CGO_ENABLED: 1 | |
QPEP_CI_ENV: 1 | |
CMAKE_BUILD_PARALLEL_LEVEL: 4 | |
IGNORE_PACKAGES: 'tray|docker|docs|version|webgui' | |
MINGW_BASEDIR: 'C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin' | |
defaults: | |
run: | |
shell: cmd | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
clean: true | |
submodules: true | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- name: Install Wix | |
uses: actions/checkout@v2 | |
with: | |
repository: fbarresi/wix | |
path: wix | |
- name: Install MSBuild | |
uses: microsoft/[email protected] | |
- name: Set up MinGW | |
uses: egor-tensin/setup-mingw@v2 | |
with: | |
platform: x64 | |
static: true | |
version: 11.1.0 | |
- name: Set up CMake | |
uses: jwlawson/[email protected] | |
with: | |
cmake-version: ${{ env.CMAKE_VERSION }} | |
- name: Prepare | |
run: | | |
@echo on | |
MKDIR build | |
MKDIR build\64bits | |
MKDIR build\32bits | |
COPY /Y windivert\LICENSE build\LICENSE.windivert | |
COPY /Y LICENSE build\LICENSE | |
go clean -cache -x | |
COPY /Y windivert\x64\* build\64bits | |
COPY /y "%MINGW_BASEDIR%\libgcc_s_seh-1.dll" build\64bits | |
COPY /y "%MINGW_BASEDIR%\libwinpthread-1.dll" build\64bits | |
COPY /y "%MINGW_BASEDIR%\libstdc++-6.dll" build\64bits | |
- name: Build Backends | |
run: | | |
cd backend/ | |
go generate | |
- name: Build QPep | |
run: | | |
go build -o build\64bits\qpep.exe | |
- name: Build QPep Tray | |
run: | | |
pushd qpep-tray | |
set CGO_ENABLED=0 | |
go build -ldflags -H=windowsgui -o ..\build\64bits\qpep-tray.exe | |
popd | |
- name: Build QPep Installer | |
run: | | |
sed -E 's/Version="[^"]+"/Version="1.${{ github.event.inputs.version_tag }}"/' installer/installer.wxs > installer/installer.wxs | |
sed -E 's/FileVersion:\s*"[^"]+"/FileVersion:\s*"v0.${{ github.event.inputs.version_tag }}"/' version/versioninfo.json > version/versioninfo.json | |
sed -E 's/ProductVersion:\s*"[^"]+"/ProductVersion:\s*"v${{ github.event.inputs.version_tag }}"/' version/versioninfo.json > version/versioninfo.json | |
set PATH=${{ github.workspace }}\wix\tools;%PATH% | |
msbuild installer\installer.sln | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: qpep_windows_v${{ github.event.inputs.version_tag }} | |
path: build/installer.msi | |
- name: Auto-cancel workflow on error | |
if: failure() | |
uses: andymckay/[email protected] | |
create-release-tag: | |
needs: [ build-windows, build-linux, build-mac-os, user-manual ] | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Download Changelog | |
uses: actions/download-artifact@v4 | |
with: | |
name: changelog_v${{ github.event.inputs.version_tag }} | |
- name: Download Windows Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: qpep_windows_v${{ github.event.inputs.version_tag }} | |
- name: Download Linux Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: qpep_linux_v${{ github.event.inputs.version_tag }} | |
- name: Download MacOS Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: qpep_macos_v${{ github.event.inputs.version_tag }} | |
- name: Download UserManual Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: qpep_user_manual | |
- name: Prepare archives | |
run: | | |
cd ${{ github.workspace }} | |
7z a -tzip qpep_windows.zip ${{ github.workspace }}/installer.msi | |
7z a -tzip qpep_linux.zip ${{ github.workspace }}/qpep | |
7z a -tzip qpep_macos.zip ${{ github.workspace }}/*.pkg | |
7z a -tzip qpep_user_manual.zip ${{ github.workspace }}/user-manual.pdf | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ github.event.inputs.version_tag }} | |
release_name: Release v${{ github.event.inputs.version_tag }} | |
body_path: changelog.txt | |
draft: ${{ inputs.test_release }} | |
prerelease: false | |
- name: Attach Windows Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: qpep_windows.zip | |
asset_name: qpep_windows_v${{ github.event.inputs.version_tag }}.zip | |
asset_content_type: application/zip | |
- name: Attach Linux Release Asset | |
id: upload-linux-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: qpep_linux.zip | |
asset_name: qpep_linux_v${{ github.event.inputs.version_tag }}.zip | |
asset_content_type: application/zip | |
- name: Attach MacOS Release Asset | |
id: upload-macos-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: qpep_macos.zip | |
asset_name: qpep_macos_v${{ github.event.inputs.version_tag }}.zip | |
asset_content_type: application/zip | |
- name: Attach UserManual Release Asset | |
id: upload-usermanual-asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: qpep_user_manual.zip | |
asset_name: qpep_user_manual_v${{ github.event.inputs.version_tag }}.zip | |
asset_content_type: application/zip |