Skip to content

agane agane

agane agane #8

Workflow file for this run

name: impacto
on:
push:
branches:
- "*"
- "!separate_renderer"
jobs:
job-matrix:
name: ${{ matrix.os_name }}-${{ github.workflow }}
runs-on: ${{ matrix.os }}
timeout-minutes: 120
outputs:
version: ${{ steps.version.outputs.version }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
os_name: windows
triplet: x64-windows-release
- os: ubuntu-latest
os_name: linux
triplet: x64-linux-release
- os: macos-latest
os_name: macos
triplet: x64-osx-release
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
vcpkgCommitId: '0f88ecb8528605f91980b90a2c5bad88e3cb565f'
steps:
- uses: actions/checkout@v3
- name: Git Version
id: version
uses: codacy/git-version@2.5.4
- name: Cache LibAtrac9
uses: actions/cache@v3
with:
key: libatrac9
path: ${{ env.Build.Repository.LocalPath }}/vendor/LibAtrac9
- uses: lukka/get-cmake@latest
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
vcpkgDirectory: '${{ runner.workspace }}/build/vcpkg'
vcpkgGitCommitId: '${{ env.vcpkgCommitId }}'
vcpkgJsonGlob: '**/vcpkg.json'
- name: Prints output of run-vcpkg's action
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ env.VCPKG_DEFAULT_TRIPLET }}'"
- name: Build Atrac9 Windows
if: matrix.os == 'windows-latest'
run: |
./build-deps.ps1 -Arg1 x64
shell: pwsh
- name: Setup Dependencies Linux/MacOS
if: matrix.os =='macos-latest' || matrix.os == 'ubuntu-latest'
run: |-
pushd vendor
git clone https://github.com/Thealexbarney/LibAtrac9.git --depth 1
cd LibAtrac9/C
if [ "${{ matrix.os_name }}" == 'macos' ]; then
sed -i '' -e 's/,--version-script=libatrac9.version//g' Makefile
fi
make
mkdir -p ../include/libatrac9
mkdir -p ../libs
cp bin/libatrac9.a ../libs/
cp src/libatrac9.h ../include/libatrac9/
popd
# echo "LIBATRAC9DIR=vendor/LibAtrac9" >> $GITHUB_ENV
- name: Install Dependencies Linux
run: sudo apt-get install nasm libx11-dev libxft-dev libxext-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libibus-1.0-dev libxrandr-dev
- name: Install Dependencies Mac
run: brew install nasm
if: matrix.os == 'ubuntu-latest'
- name: Run CMake with vcpkg.json manifest
uses: lukka/run-cmake@v10
with:
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt'
configurePreset: ci-release
buildPreset: CI-Build
- name: Copy docs
run: |
cp THIRDPARTY.md README.md LICENSE '${{ github.workspace }}/impacto-build/build/-Release'
- name: Archive Artifacts
run: 7z u impacto-${{ matrix.os_name }}-${{ steps.version.outputs.version }}-${{ github.sha }}.zip release/x64-Release
# if: startsWith(github.ref, 'refs/tags') || (github.ref == 'refs/heads/master')
- name: Upload Artifact
uses: actions/upload-artifact@v4.1.0
# if: startsWith(github.ref, 'refs/tags') || (github.ref == 'refs/heads/master')
with:
path: impacto-${{ matrix.os_name }}-${{ steps.version.outputs.version }}-${{ github.sha }}.zip
name: release-${{ matrix.os_name }}
publish_artifacts:
name: Publish Artifacts
runs-on: ubuntu-22.04
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
needs:
- job-matrix
if: ((${{needs.job-matrix.result}} == "success"))
steps:
- uses: actions/download-artifact@v4
with:
pattern: release-*
path: "${{ github.workspace }}/release"
merge-multiple: true
- name: Upload Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags') || (github.ref == 'refs/heads/master')
with:
Name: Latest ${{ env.BRANCH_NAME }} build
tag_name: ${{ needs.job-matrix.outputs.version }}
files:
${{ github.workspace }}/release/*.zip
make_latest: true
isprerelease: true
fail_on_unmatched_files: true
generate_release_notes: true
- name: Get current date
id: date
run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
- uses: tsickert/discord-webhook@v5.3.0
with:
channelid: ${{ secrets.discordChannelId }}
webhook-url: ${{ secrets.discordWebhookKey }}
name: IMPACTO
avatar: https://cdn.discordapp.com/emojis/766988033127481344.png
embed-title : "${{ github.actor }}"
embed-color: 3659647
embed-timestamp: ${{ env.NOW }}
embed-description: >
"Commit\n
`${{ github.event.head_commit.message }} (${{ github.sha }})`\n
from branch `${{ env.BRANCH_NAME }}` has been successfully built.\n\n
Release URL:\n
https://github.com/CommitteeOfZero/impacto/releases/tag/$(version)\n\n
Details:\n
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
notify_fail:
name: Notify failure
runs-on: ubuntu-22.04
needs:
- job-matrix
if: ${{needs.*.result}} == "failure" || ${{needs.*.result}} == "cancelled"
steps:
- uses: actions/checkout@v2
- name: 'Get Jobs Status'
id: get_jobs_status
run: |
echo "Fetch workflow run jobs"
json_data=$(curl -s -H "Authorization: Bearer ${{ github.token }}" \
"https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs")
name_conclusion_array=($(echo "$json_data" | jq -r '.jobs[] | select(.name | startswith("jobs-matrix")) | "\(.name).\(.conclusion)"'))
for item in "${name_conclusion_array[@]}"; do
IFS='.' read -r name conclusion <<< "$item"
echo "$name=$conclusion" >> $GITHUB_OUTPUT
done
- name: Get current date
id: date
run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_OUTPUT
- uses: tsickert/discord-webhook@v5.3.0
with:
channelid: ${{ secrets.discordChannelId }}
webhook-url: ${{ secrets.discordWebhookKey }}
name: IMPACTO
avatar: https://cdn.discordapp.com/emojis/766988033127481344.png
embed-title : "${{ github.actor }}"
embed-color: 16711680
embed-timestamp: ${{ steps.date.outputs.NOW }}
embed-description: >
"Commit\n
`${{ github.event.head_commit.message }} (${{ github.sha }})`\n
from branch `${{ env.BRANCH_NAME }}` has failed build.\n\n
Job status:\n
${{join(steps.get_jobs_status.outputs.*, '\n')}}\n\n
Details:\n
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"