Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: deploy to github pages #72

Merged
merged 4 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 27 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
name: Release
on:
workflow_run:
workflows:
- Build
branches:
- master
types:
- completed
push:
tags:
- "v*.*.*"
Expand Down Expand Up @@ -35,7 +28,7 @@ jobs:
name: dot_love-${{ github.sha }}
path: ${{ steps.dot_love.outputs.DOT_LOVE }}
if-no-files-found: error
website:
webroot:
needs:
- dot_love # Use pre-built game.love via cachix
runs-on: ubuntu-latest
Expand All @@ -48,18 +41,31 @@ jobs:
with:
name: bismuthsoft
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build
- run: nix build .#super_rogue.web.src
- run: |
env | grep -o "^AWS_[^=]*"
echo $AWS_ACCESS_KEY_ID | wc -c
echo $AWS_SECRET_ACCESS_KEY | wc -c
src=$(nix eval --raw ".#super_rogue.web.src")/
dest=s3://winny-super-rogue/
nix run .#ci.s5cmd -- sync --acl public-read "$src" "$dest"
echo https://super-rogue.workinprogress.top/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_KEY }}
printf 'WEB_SRC=%s\n' \
"$(nix eval --raw .#super_rogue.web.src)" \
>> "$GITHUB_OUTPUT"
id: web_src
# cf https://github.com/actions/upload-pages-artifact/blob/main/action.yml
- uses: actions/upload-pages-artifact@v3
with:
path: ${{ steps.web_src.outputs.WEB_SRC }}
website:
# cf https://github.com/actions/deploy-pages?tab=readme-ov-file#usage
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs:
- webroot
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
linux:
needs:
- dot_love
Expand All @@ -85,7 +91,7 @@ jobs:
build-deb: true
product-name: super-rogue
output-folder: ./dist
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist-linux
path: dist
Expand Down Expand Up @@ -147,7 +153,7 @@ jobs:
product-website: https://super-rogue.workinprogress.top
installer-languages: English.isl
output-folder: "./dist"
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: dist-windows
path: dist
Expand All @@ -173,7 +179,6 @@ jobs:
mv super_rogue_x64.zip super_rogue_windows_x64.zip
- name: Release
uses: softprops/action-gh-release@v2
# if: startsWith(github.ref, 'refs/tags/')
with:
files: |
super_rogue.love
Expand Down
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Super Rogue

[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)

*(Not [that][original-super-rogue] super rogue!)*

Inspired by [SUPERHOT][superhot].
Expand All @@ -11,11 +13,15 @@ Inspired by [SUPERHOT][superhot].

### Online

This project's default branch deploys to
[super-rogue.workinprogress.top](https://super-rogue.workinprogress.top/).
Each release is automatically published to [bismuthsoft.github.io/super_rogue][web].

[web]: https://bismuthsoft.github.io/super_rogue/

### Pre-built for Linux, Windows

See our [releases page](https://github.com/bismuthsoft/super_rogue/releases) for downloads targeting Windows, Linux, and more!

Each commit is deployed to its own public URL. See comments in PRs or GitHub
Actions transcripts for URLs.
*(Mac users, please consider downloading the `.love` file or playing [the web version][web].)*

### Run natively from source

Expand All @@ -26,13 +32,14 @@ Install [LÖVE (love2d)][love2d]. Then run:
love src
```

Or if you have nix:
Or if you have nix (non-NixOS users need [nixGL][nixGL]):

```bash
nix run .#super_rogue.desktop
```

[love2d]: https://love2d.org/
[nixGL]: https://github.com/nix-community/nixGL

### Run in-browser from source

Expand All @@ -55,7 +62,7 @@ We use a standard GitHub Pull Request workflow.
### Running tests

```bash
run run .#super_rogue.test
nix run .#super_rogue.test
```


Expand Down
Loading