2020-11-29 14:10:59 +00:00
|
|
|
name: Build release package
|
|
|
|
on:
|
|
|
|
release:
|
2021-07-01 08:50:23 +00:00
|
|
|
types: [published]
|
|
|
|
# push:
|
|
|
|
# tags: ["v*"]
|
|
|
|
# branches:
|
|
|
|
# - main
|
2020-11-29 14:10:59 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2020-11-29 18:37:57 +00:00
|
|
|
#runs-on: ubuntu-latest
|
|
|
|
runs-on: ubuntu-18.04
|
2020-11-29 14:10:59 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-11-29 14:41:35 +00:00
|
|
|
- name: Install build tools
|
|
|
|
run: |
|
|
|
|
sudo apt update
|
2021-06-11 19:49:51 +00:00
|
|
|
sudo apt install gcc-multilib g++-multilib ninja-build python3-setuptools python3-wheel mesa-common-dev libxnvctrl-dev libdbus-1-dev unzip
|
|
|
|
sudo pip3 install 'meson>=0.54' mako
|
|
|
|
wget https://github.com/KhronosGroup/glslang/releases/download/SDK-candidate-26-Jul-2020/glslang-master-linux-Release.zip
|
|
|
|
unzip glslang-master-linux-Release.zip bin/glslangValidator
|
|
|
|
sudo install -m755 bin/glslangValidator /usr/local/bin/
|
2020-11-29 14:51:45 +00:00
|
|
|
- name: Prepare Artifact Git Info
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
echo "##[set-output name=branch;]${GITHUB_REF#refs/heads/}"
|
|
|
|
ARTIFACT_NAME="commit-$(git rev-parse --short "$GITHUB_SHA")"
|
|
|
|
if [ ${{ github.event_name == 'pull_request' }} ]; then
|
|
|
|
echo "##[set-output name=short-sha;]$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")"
|
|
|
|
if [ ! -z "${{ github.event.pull_request.number }}" ]; then
|
|
|
|
ARTIFACT_NAME="pr-${{ github.event.pull_request.number }}-commit-$(git rev-parse --short "${{ github.event.pull_request.head.sha }}")"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "##[set-output name=short-sha;]$(git rev-parse --short "$GITHUB_SHA")"
|
|
|
|
fi
|
|
|
|
echo "##[set-output name=artifact-metadata;]${ARTIFACT_NAME}"
|
|
|
|
id: git-vars
|
2020-11-29 14:10:59 +00:00
|
|
|
- name: Build release package
|
|
|
|
run: |
|
|
|
|
./build-source.sh
|
2022-03-06 16:06:00 +00:00
|
|
|
./build.sh build -Dwerror=true package release
|
2020-11-29 18:37:57 +00:00
|
|
|
- name: Upload release
|
2021-07-01 08:50:23 +00:00
|
|
|
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
|
2020-11-29 18:37:57 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-11-29 14:10:59 +00:00
|
|
|
run: |
|
|
|
|
assets=()
|
2021-06-11 19:49:51 +00:00
|
|
|
for asset in ./MangoHud-*-Source*.tar.*; do
|
2020-11-29 14:10:59 +00:00
|
|
|
assets+=("-a" "$asset")
|
|
|
|
done
|
2021-06-11 19:49:51 +00:00
|
|
|
for asset in ./build/MangoHud-*.tar.*; do
|
2020-11-29 14:10:59 +00:00
|
|
|
assets+=("-a" "$asset")
|
|
|
|
done
|
|
|
|
tag_name="${GITHUB_REF##*/}"
|
2020-11-29 18:37:57 +00:00
|
|
|
hub release edit "${assets[@]}" -m "" "$tag_name"
|
|
|
|
#hub release create "${assets[@]}" -m "$tag_name" "$tag_name"
|
2020-11-29 14:10:59 +00:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
2020-11-29 14:51:45 +00:00
|
|
|
name: MangoHud-${{steps.git-vars.outputs.artifact-metadata}}
|
|
|
|
path: ${{runner.workspace}}/MangoHud/build/MangoHud-*tar.gz
|
2022-03-06 16:06:00 +00:00
|
|
|
retention-days: 30
|