This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
165 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: 'Get the current version' | ||
outputs: | ||
version: | ||
description: 'Repository version' | ||
value: ${{ steps.get_version.outputs.VERSION }} | ||
runs: | ||
using: composite | ||
steps: | ||
- name: 'Extract tag name' | ||
id: get_version | ||
run: | | ||
echo {VERSION}={$(git describe --always --abbrev=7 --tags)} >> $GITHUB_OUTPUT | ||
shell: sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: 'Prepare changelog' | ||
outputs: | ||
changelog: | ||
description: 'Changelog' | ||
value: ${{ steps.prepare_changelog.outputs.CHANGELOG }} | ||
runs: | ||
using: composite | ||
steps: | ||
- name: 'Prepare changelog' | ||
id: prepare_changelog | ||
run: | | ||
python3 -c ''' | ||
import re | ||
from pathlib import Path | ||
sections = [s for s in Path("CHANGELOG.md").read_text().split("\n\n") if re.search("- \w", s)] | ||
if sections: | ||
section = sections[0] | ||
print("\n".join(line for line in section.splitlines() if not line.startswith("#"))) | ||
''' > /tmp/changes.txt | ||
echo {CHANGELOG}={$(cat /tmp/changes.txt)} >> $GITHUB_OUTPUT | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
on: | ||
- workflow_call | ||
|
||
jobs: | ||
build_game_win: | ||
name: 'Build' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout code' | ||
uses: actions/checkout@v3 | ||
with: | ||
path: . | ||
fetch-tags: true | ||
|
||
- name: 'Install dependencies' | ||
run: | | ||
echo "$GITHUB_CONTEXT" | ||
sudo apt-get update | ||
sudo apt-get install -y make moby-engine moby-cli | ||
shell: sh | ||
|
||
- name: 'Build the game' | ||
run: | | ||
make clean release | ||
mkdir -p out/ | ||
cp build/win/*.exe out/ | ||
cp build/win/*.dll out/ | ||
cp -r bin/* out/ | ||
shell: sh | ||
|
||
- name: 'Upload the artifact' | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: game_win | ||
path: out/ | ||
|
||
package_game_win: | ||
name: 'Package' | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build_game_win | ||
steps: | ||
- name: 'Download built assets' | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: game_win | ||
path: artifacts/ | ||
|
||
- name: 'Install dependencies' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y make p7zip-full | ||
shell: sh | ||
|
||
- name: 'Package the game' | ||
run: | | ||
mkdir -p out | ||
cd artifacts | ||
7z a ../out/game-win.zip * | ||
shell: sh | ||
|
||
- name: 'Upload the artifact' | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: game_win_zip | ||
path: out/game-win.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Publish a prerelease | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
branch: develop | ||
|
||
jobs: | ||
tag_latest: | ||
name: 'Tag the repository' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Checkout code' | ||
uses: actions/checkout@v3 | ||
|
||
- name: 'Update git tag' | ||
run: | | ||
TAG='latest' | ||
git tag -a "$TAG" -m "Automatic build" ${GITHUB_SHA} | ||
git push origin "$TAG" --force-with-lease | ||
publish_prerelease: | ||
name: 'Create a prerelease' | ||
uses: ./.github/workflows/release.yml | ||
with: | ||
release_name: 'Development snapshot' | ||
draft: false | ||
prerelease: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters