name: 🏭 Release Pipeline on: push: tags: - v* jobs: # Windows build_windows_clang: name: "🖥️ Windows" uses: ./.github/workflows/windows-build-clang.yaml with: cmakePreset: "Release-windows-clang-static" cachePrefix: "static" secrets: inherit # Linux build_linux_clang: name: "🐧 Linux" uses: ./.github/workflows/linux-build-clang.yaml with: cmakePreset: "Release-linux-clang-static" cachePrefix: "static" secrets: inherit # Upload the Artifacts upload_artifacts: if: github.repository == 'open-goal/jak-project' needs: - build_windows_clang - build_linux_clang name: "Upload Artifacts" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Prepare Artifact Folder run: mkdir -p ./ci-artifacts/final - uses: actions/download-artifact@v3 name: Download all Artifacts with: path: ./ci-artifacts/ - name: Display structure of downloaded files run: ls -Rl ./ci-artifacts/ - name: Prepare Linux Release Assets run: | mkdir -p ./ci-artifacts/linux ./.github/scripts/releases/extract_build_linux.sh ./ci-artifacts/linux ./ci-artifacts/opengoal-linux-static ./ pushd ci-artifacts/linux TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}') tar czf ../final/opengoal-linux-${TAG_VAL}.tar.gz . popd strip ./ci-artifacts/opengoal-linux-static/lsp/lsp chmod +x ./ci-artifacts/opengoal-linux-static/lsp/lsp cp ./ci-artifacts/opengoal-linux-static/lsp/lsp ./ci-artifacts/final/opengoal-lsp-linux-${TAG_VAL}.bin - name: Prepare Windows Build Assets run: | mkdir -p ./ci-artifacts/windows ./.github/scripts/releases/extract_build_windows.sh ./ci-artifacts/windows ./ci-artifacts/opengoal-windows-static ./ TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}') 7z a -tzip ./ci-artifacts/final/opengoal-windows-${TAG_VAL}.zip ./ci-artifacts/windows/* cp ./ci-artifacts/opengoal-windows-static/lsp.exe ./ci-artifacts/final/opengoal-lsp-windows-${TAG_VAL}.exe - name: Upload Assets env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}') gh release upload "${TAG_VAL}" ${{ github.WORKSPACE }}/ci-artifacts/final/* --repo open-goal/jak-project --clobber - name: Publish Release env: GITHUB_TOKEN: ${{ secrets.BOT_PAT }} run: | TAG_VAL=$(echo ${{ github.REF }} | awk -F'refs/tags/' '{print $2}') gh release edit ${TAG_VAL} --draft=false --repo open-goal/jak-project - name: Consume Release in the Launcher uses: peter-evans/repository-dispatch@v2 with: token: ${{ secrets.BOT_PAT }} repository: 'open-goal/launcher' event-type: releaseLauncher