Skip to content

Commit

Permalink
ci: upgrade workflow from godot-template
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle committed Oct 24, 2023
1 parent 7f3d1dc commit 2dd4041
Show file tree
Hide file tree
Showing 19 changed files with 210 additions and 256 deletions.
5 changes: 5 additions & 0 deletions .combo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
godot:
version: '4.1.2'
game:
name: Marble
version: '1.4.1'
27 changes: 17 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ on:
push:
branches: [main]
tags: ['*']
pull_request:
branches: [main]
workflow_dispatch:

env:
tag_name: ${{ github.ref_name }}

jobs:
build:
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04
timeout-minutes: 30

strategy:
Expand All @@ -31,16 +36,18 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup Versions Vars
run: |
echo "game_version=$(cat .version)" >> $GITHUB_ENV
echo "godot_version=$(cat .godot_version)" >> $GITHUB_ENV
./bump_version.sh
- uses: MechanicalFlower/magic_combo@main
with:
command: script.add-config-to-github-env

- uses: MechanicalFlower/magic_combo@main
with:
command: script.bump-version

- name: Ensure version is equal to tag
if: startsWith(github.ref, 'refs/tags/v')
if: startsWith(github.ref, 'refs/tags/')
run: |
[ "${{ env.game_version }}" == "$GITHUB_REF_NAME" ] || exit 2
[ "${{ env.game_version }}" == "${{ env.tag_name }}" ] || exit 2
- name: Export Marble
uses: ./.github/actions/export-game
Expand Down Expand Up @@ -68,5 +75,5 @@ jobs:
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages # The branch the action should deploy to.
folder: build/web # The folder the action should deploy.
branch: gh-pages
folder: build/web
15 changes: 15 additions & 0 deletions .github/workflows/changelog_verifier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Changelog Verifier

on:
pull_request:
types: [opened, edited, review_requested, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
# Enforces the update of a changelog file on every pull request
verify-changelog:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dangoslen/changelog-enforcer@v3
with:
skipLabels: "autocut, skip-changelog"
30 changes: 30 additions & 0 deletions .github/workflows/dependabot_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Dependabot PR actions

on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]

jobs:
dependabot:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write

if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Update the changelog
uses: dangoslen/dependabot-changelog-helper@v3
with:
version: 'Unreleased'

- name: Commit the changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(changelog): automatic update to add dependabot deps bump"
branch: ${{ github.head_ref }}
commit_user_name: dependabot[bot]
commit_user_email: [email protected]
20 changes: 20 additions & 0 deletions .github/workflows/links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Link Checker
on:
push:
pull_request:

jobs:
linkchecker:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: lychee Link Checker
id: lychee
uses: lycheeverse/lychee-action@v1
with:
args: --accept=200,403,429 "**/*.html" "**/*.md" "**/*.txt" "**/*.json" --exclude "file:///github/workspace/*" --exclude-path ".github/renovate.json" --exclude-mail
fail: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
34 changes: 34 additions & 0 deletions .github/workflows/lint_pr_title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Lint PR Title

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
scopes: |
addons
assets
scripts
scenes
dependabot
workflows
readme
changelog
deps
requireScope: false
validateSingleCommit: true
validateSingleCommitMatchesPrTitle: true
4 changes: 1 addition & 3 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Pre-commit

on:
Expand All @@ -10,8 +9,7 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
Expand Down
40 changes: 25 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
workflow_run:
workflows: ["Build"]
types: [completed]
tags: ['[0-9]+.[0-9]+.[0-9]+']

env:
tag_name: ${{ github.event.workflow_run.head_branch }}

jobs:
create_release:
Expand All @@ -14,18 +16,24 @@ jobs:

name: Create Release
steps:
- name: Check Tag
run: |
if [[ ! ${{ env.tag_name }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
exit 1
fi
- name: Create Draft release
run: |
gh release create "$GITHUB_REF_NAME" \
--repo="$GITHUB_REPOSITORY" \
--title="v$GITHUB_REF_NAME" \
gh release create "${{ env.tag_name }}" \
--repo="${{ github.repository }}" \
--title="v${{ env.tag_name }}" \
--draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish:
needs: create_release
runs-on: ubuntu-22.04
runs-on: ubuntu-20.04

strategy:
fail-fast: false
Expand All @@ -46,26 +54,28 @@ jobs:
name: ${{ matrix.preset }} Publish
steps:
- name: Download artifact
uses: ./.github/actions/upload-artifact
uses: dawidd6/action-download-artifact@v2
with:
name: Marble-${{ matrix.platform }}-v$GITHUB_REF_NAME
workflow: ${{ github.event.workflow_run.workflow_id }}
name: Greeter-${{ matrix.platform }}-v${{ env.tag_name }}
path: dist/${{ matrix.platform }}
skip_unpack: true

- name: Upload to release
run: |
gh release upload "$GITHUB_REF_NAME" \
--repo="$GITHUB_REPOSITORY" \
--clobber \
dist/${{ matrix.platform }}/Marble-${{ matrix.platform }}-v$GITHUB_REF_NAME.zip
gh release upload "${{ env.tag_name }}" \
--repo="${{ github.repository }}" \
--clobber \
dist/${{ matrix.platform }}/Greeter-${{ matrix.platform }}-v${{ env.tag_name }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload to itch.io
uses: josephbmanley/[email protected]
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_API_KEY }}
CHANNEL: ${{ matrix.platform }}-v$GITHUB_REF_NAME
ITCH_GAME: marble
CHANNEL: ${{ matrix.platform }}
ITCH_GAME: greeter
ITCH_USER: mechanical-flower
PACKAGE: dist/${{ matrix.platform }}/Marble-${{ matrix.platform }}-v$GITHUB_REF_NAME.zip
VERSION: $GITHUB_REF_NAME
PACKAGE: dist/${{ matrix.platform }}/Greeter-${{ matrix.platform }}-v${{ env.tag_name }}.zip
VERSION: ${{ env.tag_name }}
1 change: 0 additions & 1 deletion .godot_version

This file was deleted.

23 changes: 4 additions & 19 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,14 @@ repos:
- id: end-of-file-fixer # Checks for ending with a newline
- id: mixed-line-ending # Consistent LF or CRLF
- id: trailing-whitespace # No trailing whitespace
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: codespell
- repo: https://github.com/fsfe/reuse-tool
rev: v2.0.0
hooks:
- id: reuse
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
hooks:
- id: bandit
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
- repo: https://github.com/codespell-project/codespell
rev: v2.2.5
hooks:
- id: mypy
- id: codespell
- repo: local
hooks:
- id: lower-case-only
Expand All @@ -51,6 +35,7 @@ repos:
public/|
Makefile|
CONTRIBUTING.md|
CHANGELOG.md|
CREDITS.md|
LICENSE.md|
README.md
Expand Down
5 changes: 0 additions & 5 deletions .reuse/dep5
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ Copyright: 2011 Destructavator
License: CC-BY-3.0
Source: https://opengameart.org/content/countdown

Files: assets/sounds/countdown/*
Copyright: 2011 Destructavator
License: CC-BY-3.0
Source: https://opengameart.org/content/countdown

Files: assets/sounds/sfx/*
Copyright: 2019 Zylann
License: CC-BY-NC-ND-1.0
Expand Down
1 change: 0 additions & 1 deletion .version

This file was deleted.

13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# CHANGELOG
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Added
### Changed
### Deprecated
### Removed
### Fixed
### Security
### Dependencies

[Unreleased]: https://github.com/MechanicalFlower/Marble/compare/1.4.1...HEAD
Loading

0 comments on commit 2dd4041

Please sign in to comment.