Skip to content
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
33 changes: 27 additions & 6 deletions .github/workflows/jsport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,46 @@ name: Build Js Port
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
merge_group:

permissions:
contents: read

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5

- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v6
with:
go-version: '1.19'
go-version: '1.21.13'

- name: Install gopherjs
run: |
go install github.com/gopherjs/gopherjs@v1.19.0-beta2
go mod download golang.org/x/exp
go install github.com/gopherjs/gopherjs@v1.21.0
go mod download

- name: Build
run: gopherjs build -m -o jsport/dicescript.cjs github.com/sealdice/dicescript/jsport
shell: bash
env:
GOFLAGS: -mod=mod
run: |
set +e
output=$(gopherjs build -m -o jsport/dicescript.cjs github.com/sealdice/dicescript/jsport 2>&1)
status=$?
printf '%s\n' "$output"
if (( status != 0 )); then
message=${output//'%'/'%25'}
message=${message//$'\r'/'%0D'}
message=${message//$'\n'/'%0A'}
echo "::error title=GopherJS build failed::$message"
fi
exit "$status"

- name: Setup pnpm
uses: pnpm/action-setup@v4
Expand All @@ -33,6 +53,7 @@ jobs:
run: cd ./jsport && pnpm install && pnpm build

- name: Deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.MY_TOKEN }}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/test_and_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.18.x'
go-version: '1.21.13'

- name: Download modules
run: go mod download
Expand All @@ -47,7 +47,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.18.x'
go-version: '1.21.13'

- name: Download modules
run: go mod download
Expand All @@ -60,6 +60,5 @@ jobs:
with:
version: v1.57.2
only-new-issues: true
skip-pkg-cache: true
skip-build-cache: true
skip-cache: true
args: --timeout 9999s
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module github.com/sealdice/dicescript

go 1.18
go 1.21

require (
github.com/gopherjs/gopherjs v1.18.0-beta1
github.com/gopherjs/gopherjs v1.21.0
github.com/peterh/liner v1.2.2
github.com/stretchr/testify v1.8.0
golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8
Expand All @@ -13,6 +13,6 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/mattn/go-runewidth v0.0.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/sys v0.23.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading