Make build-helper more generic (#314)

* Make build-helper more generic

* fix

* fix brew

* remove brew requirement since the instructions are the same

* oops

* fix

* simplify matrix
This commit is contained in:
Evan Simkowitz 2024-02-22 18:24:28 -08:00 committed by GitHub
parent a66319cfc6
commit b7539a26c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 83 additions and 116 deletions

View File

@ -5,58 +5,23 @@ env:
GO_VERSION: "1.21.5" GO_VERSION: "1.21.5"
NODE_VERSION: "21.5.0" NODE_VERSION: "21.5.0"
jobs: jobs:
runbuild-darwin-x64: runbuild:
name: "Build MacOS x64" strategy:
runs-on: macos-latest matrix:
steps: include:
- uses: actions/checkout@v4 - platform: "darwin"
- uses: actions/setup-go@v5 arch: "x64"
with: runner: "macos-latest"
go-version: ${{env.GO_VERSION}} scripthaus: "build-package"
cache-dependency-path: | - platform: "darwin"
wavesrv/go.sum arch: "arm64"
waveshell/go.sum runner: "macos-latest-xlarge"
- run: brew tap scripthaus-dev/scripthaus scripthaus: "build-package"
- run: brew install scripthaus - platform: "linux"
- uses: actions/setup-node@v4 arch: "x64"
with: runner: "ubuntu-latest"
node-version: ${{env.NODE_VERSION}} scripthaus: "build-package-linux"
cache: "yarn" runs-on: ${{ matrix.runner }}
- run: yarn --frozen-lockfile
- run: scripthaus run build-package
- uses: actions/upload-artifact@v4
with:
name: waveterm-build-darwin-x64
path: out/make/zip/darwin/x64/*.zip
retention-days: 2
runbuild-darwin-arm64:
name: "Build MacOS arm64"
runs-on: macos-latest-xlarge
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{env.GO_VERSION}}
cache-dependency-path: |
wavesrv/go.sum
waveshell/go.sum
- run: brew tap scripthaus-dev/scripthaus
- run: brew install scripthaus
- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
cache: "yarn"
- run: yarn --frozen-lockfile
- run: scripthaus run build-package
- uses: actions/upload-artifact@v4
with:
name: waveterm-build-darwin-arm64
path: out/make/zip/darwin/arm64/*.zip
retention-days: 2
runbuild-linux:
name: "Build Linux x64"
runs-on: ubuntu-latest
needs: [runbuild-darwin-x64, runbuild-darwin-arm64]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -80,21 +45,24 @@ jobs:
node-version: ${{env.NODE_VERSION}} node-version: ${{env.NODE_VERSION}}
cache: "yarn" cache: "yarn"
- run: yarn --frozen-lockfile - run: yarn --frozen-lockfile
- run: ./scripthaus/scripthaus run build-package-linux - 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:
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v4
with: with:
merge-multiple: true merge-multiple: true
path: buildtemp path: buildtemp
- run: |
mv out/make/zip/linux/x64/Wave-linux-x64-$WAVETERM_VERSION.zip buildtemp/waveterm-linux-x64-v$WAVETERM_VERSION.zip
- run: (cd buildtemp; zip ../waveterm-builds.zip *) - run: (cd buildtemp; zip ../waveterm-builds.zip *)
- run: aws s3 cp waveterm-builds.zip s3://waveterm-github-artifacts/ - run: aws s3 cp waveterm-builds.zip s3://waveterm-github-artifacts/
env: env:
AWS_ACCESS_KEY_ID: "${{ secrets.S3_USERID }}" AWS_ACCESS_KEY_ID: "${{ secrets.S3_USERID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.S3_SECRETKEY }}" AWS_SECRET_ACCESS_KEY: "${{ secrets.S3_SECRETKEY }}"
AWS_DEFAULT_REGION: us-west-2 AWS_DEFAULT_REGION: us-west-2
- uses: actions/upload-artifact@v4
with:
name: waveterm-builds
path: buildtemp
retention-days: 2

View File

@ -13,11 +13,11 @@ name: "CodeQL"
on: on:
push: push:
branches: [ "main" ] branches: ["main"]
pull_request: pull_request:
branches: [ "main" ] branches: ["main"]
schedule: schedule:
- cron: '36 5 * * 5' - cron: "36 5 * * 5"
jobs: jobs:
analyze: analyze:
@ -37,7 +37,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
language: [ 'go', 'javascript-typescript' ] language: ["go", "javascript-typescript"]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
@ -59,7 +59,6 @@ jobs:
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality # queries: security-extended,security-and-quality
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below) # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild - name: Autobuild