Skip to content

Instantly share code, notes, and snippets.

@halkeye
Created January 28, 2024 02:36
Show Gist options
  • Save halkeye/4facd3262d77e011bd5950092590f0c4 to your computer and use it in GitHub Desktop.
Save halkeye/4facd3262d77e011bd5950092590f0c4 to your computer and use it in GitHub Desktop.
.github/workflows/build.yaml
name: "godot-ci export"
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}
env:
GODOT_VERSION: 4.2
EXPORT_NAME: pirate-games-jam-2024
jobs:
build-and-publish:
name: Build and Publish
permissions:
contents: read
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
runs-on: self-hosted
container:
image: barichello/godot-ci:4.2.1
# Deploy to the github-pages environment
environment:
name: github-pages
url: https://halkeye.itch.io/not-the-plants
# url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: false
- name: Setup
run: |
mkdir -v -p ~/.local/share/godot/templates
mv /root/.local/share/godot/templates/ ~/.local/share/godot/export_templates/
- name: Remove .godot
run:
find -name .godot -exec rm -rf {} \;
- name: Set Version
working-directory: 'godotproject'
run: |
sed -i 's|%VERSION%|Sha: ${{ github.sha }}|g' globals/debug_bar.gd
- name: Build
working-directory: 'godotproject'
run: |
mkdir -v -p build/{windows,linux,mac,web}
timeout 60 godot --headless --editor --quit
godot -v --headless --export-debug "web"
godot -v --headless --export-debug "windows"
godot -v --headless --export-debug "linux"
godot -v --headless --export-debug "mac"
- name: Borrow enable-threads script
working-directory: 'godotproject'
run: wget -O build/web/coi-serviceworker.min.js https://raw.githubusercontent.com/gzuidhof/coi-serviceworker/master/coi-serviceworker.min.js
- name: Preload threads script
working-directory: 'godotproject'
run: |-
sed -i 's|<script src="index.js"></script>|<script src="coi-serviceworker.min.js"></script><script src="index.js?m=${{ github.sha }}"></script>|g' build/web/index.html
- uses: manleydev/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: "${{ secrets.BUTLER_API_KEY }}"
CHANNEL: windows
ITCH_GAME: not-the-plants
ITCH_USER: halkeye
PACKAGE: godotproject/build/windows
- uses: manleydev/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: "${{ secrets.BUTLER_API_KEY }}"
CHANNEL: web
ITCH_GAME: not-the-plants
ITCH_USER: halkeye
PACKAGE: godotproject/build/web
- uses: manleydev/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: "${{ secrets.BUTLER_API_KEY }}"
CHANNEL: linux
ITCH_GAME: not-the-plants
ITCH_USER: halkeye
PACKAGE: godotproject/build/linux
- uses: manleydev/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: "${{ secrets.BUTLER_API_KEY }}"
CHANNEL: mac
ITCH_GAME: not-the-plants
ITCH_USER: halkeye
PACKAGE: godotproject/build/mac
- name: Send message to discord
uses: halkeye/discord-commits@patch-1
with:
webhook: "${{ secrets.DISCORD_WEBHOOK }}?thread_id=1194497438103388180"
template: 'avatar-with-link'
include-extras: true
message: "Commits to **{{ github.context.payload.repository.owner.name }}/{{ github.context.payload.repository.name}}**. Web and Windows shared to: https://halkeye.itch.io/not-the-plants"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment