From a00a1c67f1980fb2c736d296f0826900952447e9 Mon Sep 17 00:00:00 2001 From: seven Date: Sat, 13 Jan 2024 17:26:52 +0800 Subject: [PATCH] feat: release pipeline #3 Signed-off-by: seven --- .github/workflows/release.yml | 34 +++++++++++++++++++++------------- scripts/release.sh | 3 +++ 2 files changed, 24 insertions(+), 13 deletions(-) mode change 100644 => 100755 scripts/release.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 940624b0..07fb8305 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,21 +3,29 @@ on: release: branches: [master] types: [created] - jobs: build: - runs-on: ubuntu-latest + strategy: + matrix: + os: + [ + { name: 'linux', image: 'ubuntu-latest' }, + { name: 'windows', image: 'windows-latest' }, + { name: 'macos', image: 'macos-latest' }, + ] + runs-on: ${{ matrix.os.image }} steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 + - name: Github checkout + uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 with: - node-version: '18.x' - registry-url: 'https://registry.npmjs.org' - - name: Install dependencies and build 🔧 - run: npm ci && npm run build - - name: Publish package on NPM 📦 - run: npm publish --access public + node-version: 20 + - run: npm ci + - run: npm run build + - name: Build app + run: ./scripts/make-distributions.sh + - name: Publish app env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} + run: ./scripts/release.sh diff --git a/scripts/release.sh b/scripts/release.sh old mode 100644 new mode 100755 index 1f6b8bed..ad94d464 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -2,3 +2,6 @@ set -o pipefail cd "$(dirname "$0")/.." || exit + + +npx electron-forge publish