Skip to content

Commit 979b93f

Browse files
committed
Merge development back into maintenance
2 parents 806daeb + d672539 commit 979b93f

File tree

2,297 files changed

+104753
-48251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,297 files changed

+104753
-48251
lines changed

.github/workflows/bump_version.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Bump Version
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
# --- Bump version
8+
bump-version:
9+
10+
runs-on: ubuntu-latest
11+
environment: deploy-pypi-test
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
token: ${{ secrets.MY_TOKEN }}
18+
- name: Bump versions
19+
uses: remorses/bump-version@js
20+
with:
21+
version_file: ./arcade/VERSION
22+
prerelease_tag: rc
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Create Commit Note Log
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
workflow_dispatch:
8+
inputs:
9+
git-tag:
10+
description: tag to create notes off of
11+
required: true
12+
13+
jobs:
14+
create-commit-note-log:
15+
name: Create Commit Note Log
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set tag from input
23+
id: tag-input
24+
if: github.event_name == 'workflow_dispatch'
25+
run: |-
26+
tag=${{ github.event.inputs.git-tag }}
27+
if git rev-parse -q --verify "refs/tags/$tag" >/dev/null; then
28+
echo ::set-output name=tag::${{ github.event.inputs.git-tag }}
29+
else
30+
echo "Tag not found"
31+
exit 1
32+
fi
33+
- name: Set tag from commit
34+
id: tag-commit
35+
if: github.event_name != 'workflow_dispatch'
36+
run: |-
37+
git_ref="${GITHUB_REF#refs/*/}"
38+
echo ::set-output name=tag::$git_ref
39+
- name: Get Git commit history
40+
id: git-commit
41+
run: |-
42+
current_tag=${{ steps.tag-input.outputs.tag || steps.tag-commit.outputs.tag }}
43+
previous_tag=$(git describe --abbrev=0 --match "*" --tags $current_tag^)
44+
echo "current_tag=$current_tag"
45+
echo "previous_tag=$previous_tag"
46+
echo "commit_history"
47+
echo "=============="
48+
while read -r;
49+
do
50+
echo "- $REPLY" | tee -a body.md
51+
done < <(git log --pretty=oneline --abbrev-commit --decorate-refs-exclude=refs/tags $current_tag...$previous_tag)
52+
echo "=============="
53+
echo ::set-output name=tag::$current_tag
54+
- uses: ncipollo/release-action@v1
55+
with:
56+
bodyFile: "body.md"
57+
tag: ${{ steps.git-commit.outputs.tag }}
58+
allowUpdates: true
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Distribute build to PyPi Production
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'Tag to deploy'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
13+
# --- Deploy to pypi
14+
deploy-to-pypi-prod:
15+
16+
runs-on: ubuntu-latest
17+
environment: deploy-pypi-prod
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
with:
22+
fetch-tags: 'true'
23+
ref: ${{ github.event.inputs.tag }}
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: 3.x
28+
- name: Install dependencies
29+
run: >-
30+
python -m pip install build twine
31+
- name: Build and Upload to Prod PyPI
32+
run: |
33+
python -m build --sdist --wheel --outdir dist/
34+
python3 -m twine upload dist/*
35+
env:
36+
TWINE_USERNAME: __token__
37+
TWINE_PASSWORD: ${{ secrets.TWINE_PROD_TOKEN }}
38+
TWINE_REPOSITORY: pypi
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Distribute build to PyPi Test
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
# --- Bump version
8+
bump-version:
9+
10+
runs-on: ubuntu-latest
11+
environment: deploy-pypi-test
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
- name: Bump versions
17+
uses: remorses/bump-version@js
18+
with:
19+
version_file: ./arcade/VERSION
20+
prerelease_tag: dev
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.MY_TOKEN }}
23+
24+
# --- Deploy to pypi
25+
deploy-to-pypi-test:
26+
27+
runs-on: ubuntu-latest
28+
environment: deploy-pypi-test
29+
needs: bump-version
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-tags: 'true'
35+
- name: Set up Python
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: 3.x
39+
- name: Install dependencies
40+
run: >-
41+
python3 -m pip install build twine
42+
- name: Build and Upload to Test PyPI
43+
run: |
44+
python3 -m build --sdist --wheel --outdir dist/
45+
python3 -m twine upload dist/*
46+
env:
47+
TWINE_USERNAME: __token__
48+
TWINE_PASSWORD: ${{ secrets.TWINE_TEST_TOKEN }}
49+
TWINE_REPOSITORY: testpypi
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# This is our full unit tests
2+
# Self-hosted, run on an old notebook
3+
name: Unit testing
4+
5+
on:
6+
push:
7+
branches: [development, maintenance]
8+
pull_request:
9+
branches: [development, maintenance]
10+
workflow_dispatch:
11+
12+
jobs:
13+
14+
build:
15+
name: Unit tests
16+
runs-on: self-hosted
17+
18+
strategy:
19+
matrix:
20+
os: [ubuntu-latest]
21+
python-version: ['3.9.13', '3.10', '3.11', '3.12', '3.13']
22+
architecture: ['x64']
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Setup Python
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install dependencies part 1
32+
run: |
33+
rm -rf .venv
34+
python -m venv .venv
35+
source .venv/bin/activate
36+
pip install --upgrade pip
37+
python -m pip install -U pip wheel setuptools
38+
- name: Install dependencies part 2
39+
run: |
40+
source .venv/bin/activate
41+
python -m pip install -I -e .[testing_libraries]
42+
- name: Test with pytest
43+
run: |
44+
source .venv/bin/activate
45+
which python
46+
python -c "import pyglet; print('pyglet version', pyglet.__version__)"
47+
python -c "import PIL; print('Pillow version', PIL.__version__)"
48+
pytest --maxfail=10
49+
50+
# Prepare the Pull Request Payload artifact. If this fails, we
51+
# we fail silently using the `continue-on-error` option. It's
52+
# nice if this succeeds, but if it fails for any reason, it
53+
# does not mean that our main workflow has failed.
54+
- name: Prepare Pull Request Payload artifact
55+
id: prepare-artifact
56+
if: always() && github.event_name == 'pull_request'
57+
continue-on-error: true
58+
run: cat $GITHUB_EVENT_PATH | jq '.pull_request' > pull_request_payload.json
59+
60+
# This only makes sense if the previous step succeeded. To
61+
# get the original outcome of the previous step before the
62+
# `continue-on-error` conclusion is applied, we use the
63+
# `.outcome` value. This step also fails silently.
64+
- name: Upload a Build Artifact
65+
if: always() && steps.prepare-artifact.outcome == 'success'
66+
continue-on-error: true
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: pull-request-payload
70+
path: pull_request_payload.json
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Status Embed
2+
3+
on:
4+
workflow_run:
5+
workflows:
6+
- GitHub Ubuntu test
7+
- Windows self-hosted test
8+
types:
9+
- completed
10+
11+
jobs:
12+
status_embed:
13+
name: Send Status Embed to Discord
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
# Process the artifact uploaded in the `pull_request`-triggered workflow:
18+
- name: Get Pull Request Information
19+
id: pr_info
20+
if: github.event.workflow_run.event == 'pull_request'
21+
run: |
22+
curl -s -H "Authorization: token $GITHUB_TOKEN" ${{ github.event.workflow_run.artifacts_url }} > artifacts.json
23+
DOWNLOAD_URL=$(cat artifacts.json | jq -r '.artifacts[] | select(.name == "pull-request-payload") | .archive_download_url')
24+
[ -z "$DOWNLOAD_URL" ] && exit 1
25+
wget --quiet --header="Authorization: token $GITHUB_TOKEN" -O pull_request_payload.zip $DOWNLOAD_URL || exit 2
26+
unzip -p pull_request_payload.zip > pull_request_payload.json
27+
[ -s pull_request_payload.json ] || exit 3
28+
echo "::set-output name=pr_author_login::$(jq -r '.user.login // empty' pull_request_payload.json)"
29+
echo "::set-output name=pr_number::$(jq -r '.number // empty' pull_request_payload.json)"
30+
echo "::set-output name=pr_title::$(jq -r '.title // empty' pull_request_payload.json)"
31+
echo "::set-output name=pr_source::$(jq -r '.head.label // empty' pull_request_payload.json)"
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
35+
# Send an informational status embed to Discord instead of the
36+
# standard embeds that Discord sends. This embed will contain
37+
# more information and we can fine tune when we actually want
38+
# to send an embed.
39+
- name: GitHub Actions Status Embed for Discord
40+
uses: SebastiaanZ/[email protected]
41+
with:
42+
# Webhook token
43+
webhook_id: ${{ secrets.WEBHOOK_ID }}
44+
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
45+
46+
# We need to provide the information of the workflow that
47+
# triggered this workflow instead of this workflow.
48+
workflow_name: ${{ github.event.workflow_run.name }}
49+
run_id: ${{ github.event.workflow_run.id }}
50+
run_number: ${{ github.event.workflow_run.run_number }}
51+
status: ${{ github.event.workflow_run.conclusion }}
52+
actor: ${{ github.actor }}
53+
repository: ${{ github.repository }}
54+
ref: ${{ github.ref }}
55+
sha: ${{ github.event.workflow_run.head_sha }}
56+
57+
# Now we can use the information extracted in the previous step:
58+
pr_author_login: ${{ steps.pr_info.outputs.pr_author_login }}
59+
pr_number: ${{ steps.pr_info.outputs.pr_number }}
60+
pr_title: ${{ steps.pr_info.outputs.pr_title }}
61+
pr_source: ${{ steps.pr_info.outputs.pr_source }}

0 commit comments

Comments
 (0)