2024-01-17 05:37:46 +01:00
|
|
|
name: "Build Helper"
|
2024-01-08 08:48:10 +01:00
|
|
|
on: workflow_dispatch
|
2024-01-08 08:58:46 +01:00
|
|
|
env:
|
2024-01-29 18:39:36 +01:00
|
|
|
GO_VERSION: "1.21.5"
|
|
|
|
NODE_VERSION: "21.5.0"
|
2024-01-08 08:48:10 +01:00
|
|
|
jobs:
|
2024-02-23 03:24:28 +01:00
|
|
|
runbuild:
|
2024-02-24 02:44:00 +01:00
|
|
|
outputs:
|
|
|
|
WAVETERM_VERSION: ${{ steps.set-version.outputs.WAVETERM_VERSION }}
|
2024-02-23 03:24:28 +01:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- platform: "darwin"
|
|
|
|
arch: "x64"
|
|
|
|
runner: "macos-latest"
|
|
|
|
scripthaus: "build-package"
|
|
|
|
- platform: "darwin"
|
|
|
|
arch: "arm64"
|
|
|
|
runner: "macos-latest-xlarge"
|
|
|
|
scripthaus: "build-package"
|
|
|
|
- platform: "linux"
|
|
|
|
arch: "x64"
|
|
|
|
runner: "ubuntu-latest"
|
|
|
|
scripthaus: "build-package-linux"
|
|
|
|
runs-on: ${{ matrix.runner }}
|
2024-01-17 05:37:46 +01:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
2024-01-29 18:39:36 +01:00
|
|
|
repository: scripthaus-dev/scripthaus
|
|
|
|
path: scripthaus
|
2024-02-23 01:31:49 +01:00
|
|
|
- uses: actions/setup-go@v5
|
2024-01-17 05:37:46 +01:00
|
|
|
with:
|
2024-01-29 18:39:36 +01:00
|
|
|
go-version: ${{env.GO_VERSION}}
|
|
|
|
cache-dependency-path: |
|
|
|
|
wavesrv/go.sum
|
|
|
|
waveshell/go.sum
|
|
|
|
scripthaus/go.sum
|
2024-01-17 06:46:44 +01:00
|
|
|
- run: |
|
2024-01-29 18:39:36 +01:00
|
|
|
go work use ./scripthaus;
|
|
|
|
cd scripthaus;
|
|
|
|
go get ./...;
|
|
|
|
CGO_ENABLED=1 go build -o scripthaus cmd/main.go
|
2024-01-17 05:37:46 +01:00
|
|
|
- uses: actions/setup-node@v4
|
|
|
|
with:
|
2024-01-29 18:39:36 +01:00
|
|
|
node-version: ${{env.NODE_VERSION}}
|
|
|
|
cache: "yarn"
|
2024-02-24 02:44:00 +01:00
|
|
|
- id: set-version
|
|
|
|
run: |
|
2024-02-24 00:14:25 +01:00
|
|
|
VERSION=$(node -e 'console.log(require("./version.js"))')
|
2024-02-24 02:44:00 +01:00
|
|
|
echo "WAVETERM_VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
|
2024-01-17 05:37:46 +01:00
|
|
|
- run: yarn --frozen-lockfile
|
2024-02-23 03:24:28 +01:00
|
|
|
- run: ./scripthaus/scripthaus run ${{ matrix.scripthaus }}
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: waveterm-build-${{ matrix.platform }}-${{ matrix.arch }}
|
|
|
|
path: out/make/zip/${{ matrix.platform }}/${{ matrix.arch }}/*.zip
|
|
|
|
retention-days: 2
|
|
|
|
upload:
|
|
|
|
name: "Upload Builds"
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [runbuild]
|
|
|
|
steps:
|
2024-01-17 07:35:17 +01:00
|
|
|
- uses: actions/download-artifact@v4
|
|
|
|
with:
|
2024-01-29 18:39:36 +01:00
|
|
|
merge-multiple: true
|
|
|
|
path: buildtemp
|
2024-02-24 02:44:00 +01:00
|
|
|
- run: |
|
|
|
|
echo "${{ needs.runbuild.outputs.WAVETERM_VERSION }}" > buildtemp/version.txt
|
2024-01-18 02:51:50 +01:00
|
|
|
- run: (cd buildtemp; zip ../waveterm-builds.zip *)
|
|
|
|
- run: aws s3 cp waveterm-builds.zip s3://waveterm-github-artifacts/
|
|
|
|
env:
|
2024-01-29 18:39:36 +01:00
|
|
|
AWS_ACCESS_KEY_ID: "${{ secrets.S3_USERID }}"
|
|
|
|
AWS_SECRET_ACCESS_KEY: "${{ secrets.S3_SECRETKEY }}"
|
|
|
|
AWS_DEFAULT_REGION: us-west-2
|