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

@ -12,70 +12,69 @@
name: "CodeQL" 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:
name: Analyze name: Analyze
# Runner size impacts CodeQL analysis time. To learn more, please see: # Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql # - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources # - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners # - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements. # Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions: permissions:
actions: read actions: read
contents: read contents: read
security-events: write security-events: write
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
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v3 uses: github/codeql-action/init@v3
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file. # If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file. # By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file. # Prefix the list here with "+" to use these queries and those in the config file.
# 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).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). # Command-line programs to run using the OS shell.
# If this step fails, then you should remove it and run the build manually (see below) # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- name: Autobuild
uses: github/codeql-action/autobuild@v3
# Command-line programs to run using the OS shell. # If the Autobuild fails above, remove it and uncomment the following three lines.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
# If the Autobuild fails above, remove it and uncomment the following three lines. # - run: |
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. # echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
# - run: | - name: Perform CodeQL Analysis
# echo "Run, Build Application using script" uses: github/codeql-action/analyze@v3
# ./location_of_script_within_repo/buildscript.sh with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"