From 4c23986d80e7d5c59cdf82a09a294a70115193c0 Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 16 Dec 2024 22:11:21 -0500 Subject: [PATCH] Add action to validate build on push/PRs, use Node.js 20 --- .github/workflows/build.yml | 23 +++++++++++++++++++++ .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/{main.yml => release.yml} | 17 +++++++++++---- mise.toml | 2 ++ 4 files changed, 39 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build.yml rename .github/workflows/{main.yml => release.yml} (81%) create mode 100644 mise.toml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..daaa7bb2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: Build +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'yarn' + + - name: Install modules + run: yarn + + - name: Build + run: yarn build diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7ed83923..f29e93ef 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -37,7 +37,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/main.yml b/.github/workflows/release.yml similarity index 81% rename from .github/workflows/main.yml rename to .github/workflows/release.yml index 667ea21c..ae80502b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/release.yml @@ -3,20 +3,28 @@ on: release: types: - released + jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - submodules: 'recursive' - - uses: c-hive/gha-yarn-cache@v1 + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: 'yarn' + - name: Install modules run: yarn + - name: Build extensions run: | VERSION=$(echo -n ${{ github.ref }} | sed 's/[refs\/tagv]//g') yarn build yarn package + - name: Upload Chrome package to release uses: svenstaro/upload-release-action@v2 with: @@ -25,6 +33,7 @@ jobs: asset_name: HyperChat-Chrome.zip tag: ${{ github.ref }} overwrite: true + - name: Upload Firefox package to release uses: svenstaro/upload-release-action@v2 with: diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000..126f6807 --- /dev/null +++ b/mise.toml @@ -0,0 +1,2 @@ +[tools] +node = "20"