Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 15 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,20 @@
name: CI

# Builds and tests every push that changes more than documents. Tags are left
# out: a tag's commit has already been built on its branch. The game-data check
# runs for every push, in game-data.yml.
# Builds and tests every push to main and every pull request, and checks that
# no game data is committed.
on:
push:
branches: ['**']
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
- '.github/ISSUE_TEMPLATE/**'
- '.github/dependabot.yml'
- '.github/workflows/game-data.yml'
- '.github/workflows/package.yml'
branches: [main]
pull_request:
paths-ignore:
- '**.md'
- 'docs/**'
- 'LICENSE'
- '.github/ISSUE_TEMPLATE/**'
- '.github/dependabot.yml'
- '.github/workflows/game-data.yml'
- '.github/workflows/package.yml'
workflow_dispatch:

permissions:
contents: read

# A newer push to the same branch or pull request cancels the older run, except
# on main, where every commit gets its run: each has a group of its own, as
# GitHub keeps only one waiting run per group and cancels the others.
# A newer push to the same pull request cancels the older run.
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.sha || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

# ccache (installed by ccache-action) keeps the compiled objects from the last
# run of each job, so a push recompiles only what it changed. CMake takes the
Expand All @@ -43,15 +24,18 @@ env:
CMAKE_C_COMPILER_LAUNCHER: ccache
CMAKE_CXX_COMPILER_LAUNCHER: ccache

# Every job runs for pushes and manual runs, and for pull requests only from
# forks: a branch of this repository has already run on its push. Windows and
# macOS runner minutes cost 2x and 10x Linux's, so those jobs start only once
# the Linux builds pass: a newer push cancels the run before they start, and a
# change that breaks the build doesn't spend them.
jobs:
game-data:
name: No game data
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check the tracked files
run: python3 tools/check_game_data.py

linux:
name: Linux (${{ matrix.compiler }})
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
Expand Down Expand Up @@ -99,7 +83,6 @@ jobs:

macos:
name: macOS (Apple Clang)
needs: linux
runs-on: macos-15
timeout-minutes: 20
steps:
Expand All @@ -120,7 +103,6 @@ jobs:

windows:
name: Windows (clang-cl)
needs: linux
runs-on: windows-latest
timeout-minutes: 30
steps:
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/game-data.yml

This file was deleted.

37 changes: 13 additions & 24 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,12 @@ name: Package
# from their own disc image, and the launcher players open, OpenGP, which
# builds the games with the installer's code. No game code or data is in them.
#
# It runs for every version tag and by hand (Actions > Package > Run workflow,
# or `gh workflow run package.yml --ref <branch>`), and on main and pull
# requests only when the build itself changes; CI builds and tests every other
# change. Run it by hand on the release commit before tagging.
# Pushing a version tag (v1.2.3) builds the packages and attaches them to a
# draft release, with that version's CHANGELOG.md section as its notes. A run
# by hand (Actions > Package > Run workflow) only builds and tests them.
on:
push:
branches: [main]
tags: ['v*']
# Not checked for tags: every tag runs.
paths:
- '**/CMakeLists.txt'
- '**/*.cmake'
- 'CMakePresets.json'
- 'tools/installer/**'
- 'tools/package_probe.py'
- '.github/workflows/package.yml'
pull_request:
paths:
- '**/CMakeLists.txt'
- '**/*.cmake'
- 'CMakePresets.json'
- 'tools/installer/**'
- 'tools/package_probe.py'
- '.github/workflows/package.yml'
workflow_dispatch:
inputs:
launcher_ref:
Expand All @@ -47,10 +29,8 @@ env:
permissions:
contents: read

# A newer push to the same pull request cancels the older run.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

jobs:
windows:
Expand Down Expand Up @@ -392,8 +372,13 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
sparse-checkout: CHANGELOG.md
sparse-checkout-cone-mode: false
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
path: packages
merge-multiple: true
- name: Upload the packages
env:
Expand All @@ -408,7 +393,11 @@ jobs:
exit 1
fi
else
gh release create "$TAG" --repo "$GITHUB_REPOSITORY" --draft --title "OpenGP ${TAG#v}" --notes "See CHANGELOG.md."
# The notes: the lines under "## <version>" (or "## <version> (date)").
awk -v v="${TAG#v}" '/^## / { f = ($2 == v); next } f' CHANGELOG.md > notes.md
[ -s notes.md ] || echo "See CHANGELOG.md." > notes.md
gh release create "$TAG" --repo "$GITHUB_REPOSITORY" --draft --title "OpenGP ${TAG#v}" --notes-file notes.md
fi
cd packages
sha256sum OpenGP-* > SHA256SUMS
gh release upload "$TAG" --repo "$GITHUB_REPOSITORY" --clobber OpenGP-* SHA256SUMS
Loading