Skip to content

Commit

Permalink
ci(github): build and upload distributions in workflow release-please…
Browse files Browse the repository at this point in the history
….yml
  • Loading branch information
remarkablemark committed Jun 30, 2024
1 parent f60d270 commit 63ae8f7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,21 @@ jobs:
with:
web: true

- name: Web build
run: renpy-launcher web_build . --destination dist

- name: Copy web presplash
run: cp web-presplash.jpg dist/web-presplash.jpg
- name: Build web
run: |
renpy-launcher web_build . --destination web
cp web-presplash.jpg web/web-presplash.jpg
- name: Deploy
if: github.ref_name == 'master'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: dist
folder: web

- name: Upload artifacts
if: github.ref_name == 'master'
uses: actions/upload-artifact@v4
with:
name: build-artifact
path: dist
name: web_build
path: web
24 changes: 19 additions & 5 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,36 @@ jobs:

- name: Setup Ren'Py
uses: remarkablegames/setup-renpy@v1
id: renpy
with:
web: true

- name: Web build
run: renpy-cli ${{ steps.renpy.outputs.launcher }} web_build . --destination web
- name: Build packages
run: renpy-launcher distribute . --dest dists

- name: Rename packages
run: |
# e.g., "dists/psych-101-1.2.3-linux.tar.bz2" -> "dists/linux.tar.bz2"
for filename in dists/*; do mv "$filename" "dists/${filename##*-}"; done
- name: Build web
run: renpy-launcher web_build . --destination dists/web

- name: Setup butler
uses: remarkablegames/setup-butler@v1

# https://www.renpy.org/doc/html/build.html#var-build.itch_channels
- name: Upload to itch.io
run: butler push web ${{ github.repository }}:web --userversion-file version.txt
run: |
for i in "web web" "linux.tar.bz2 linux" "mac.zip osx" "market.zip win-osx-linux" "pc.zip win-linux" "win.zip win"
do
set -- $i
butler push dists/$1 ${{ github.repository }}:$2 --userversion-file version.txt
done
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}

- name: Upload Release Artifact
run: gh release upload ${{ needs.release.outputs.tag_name }} web.zip
run: |
gh release upload ${{ needs.release.outputs.tag_name }} $(ls dists/*)
env:
GITHUB_TOKEN: ${{ github.token }}

0 comments on commit 63ae8f7

Please sign in to comment.