2020-11-29 14:10:59 +00:00
|
|
|
name: Build release package
|
|
|
|
on:
|
|
|
|
release:
|
2021-07-01 08:50:23 +00:00
|
|
|
types: [published]
|
2020-11-29 14:10:59 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2023-03-03 18:18:45 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2020-11-29 14:10:59 +00:00
|
|
|
|
|
|
|
steps:
|
2023-03-12 13:24:21 +00:00
|
|
|
- uses: actions/checkout@v3
|
2020-11-29 14:41:35 +00:00
|
|
|
- name: Install build tools
|
|
|
|
run: |
|
2024-04-03 17:29:12 +00:00
|
|
|
set -x
|
2024-04-05 00:20:23 +00:00
|
|
|
sudo dpkg --add-architecture i386
|
2024-05-25 15:10:03 +00:00
|
|
|
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
|
|
|
|
echo "deb [signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages focal main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
|
2020-11-29 14:41:35 +00:00
|
|
|
sudo apt update
|
2024-04-03 17:29:12 +00:00
|
|
|
sudo apt -y install gcc-multilib g++-multilib ninja-build python3-setuptools \
|
|
|
|
python3-wheel mesa-common-dev libxnvctrl-dev libdbus-1-dev \
|
|
|
|
python3-numpy python3-matplotlib unzip hub libxkbcommon-dev libwayland-dev wget unzip \
|
2024-05-25 15:10:03 +00:00
|
|
|
libxkbcommon-dev:i386 libwayland-dev:i386 gh
|
2024-04-03 17:29:12 +00:00
|
|
|
sudo pip3 --no-input install 'meson>=0.60' mako
|
2021-06-11 19:49:51 +00:00
|
|
|
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
|
2024-05-25 17:14:47 +00:00
|
|
|
echo "##[set-output name=artifact-metadata;]$ARTIFACT_NAME"
|
|
|
|
- name: Build and package
|
2024-05-25 16:42:57 +00:00
|
|
|
run: |
|
|
|
|
./build-source.sh
|
|
|
|
./build.sh build -Dwerror=true package release
|
2024-05-25 17:14:47 +00:00
|
|
|
- name: Authenticate with GitHub
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
run: |
|
|
|
|
hub api user
|
2024-05-25 15:10:03 +00:00
|
|
|
- name: Upload assets to release
|
|
|
|
if: github.event.action == 'published'
|
2024-04-03 17:29:12 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2020-11-29 14:10:59 +00:00
|
|
|
run: |
|
2024-04-03 17:29:12 +00:00
|
|
|
set -x
|
2024-05-25 17:27:47 +00:00
|
|
|
git config --global hub.protocol https
|
|
|
|
hub release create -p -m "Release $tag_name" "$tag_name"
|
2020-11-29 14:10:59 +00:00
|
|
|
assets=()
|
2024-05-25 15:10:03 +00:00
|
|
|
for pkg in ./build/*.tar.*; do
|
|
|
|
echo $pkg
|
|
|
|
assets+=("-a" "$pkg")
|
2020-11-29 14:10:59 +00:00
|
|
|
done
|
2020-11-29 18:37:57 +00:00
|
|
|
hub release edit "${assets[@]}" -m "" "$tag_name"
|
2024-05-25 15:10:03 +00:00
|
|
|
|
2020-11-29 14:10:59 +00:00
|
|
|
- name: Upload artifact
|
2023-03-12 13:25:22 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2020-11-29 14:10:59 +00:00
|
|
|
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
|
2024-05-25 17:14:47 +00:00
|
|
|
retention-days: 30
|