diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 4a0ba7e4..46e46122 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -37,7 +37,7 @@ jobs: shell: bash run: echo "Building from branch=$(git rev-parse --abbrev-ref HEAD), commit=$(git rev-parse HEAD), tag=$(git describe --tags --exact-match)" - - name: Setup Node.js ${{ needs.get-configs.outputs.node-version }} (${{ inputs.runs-on }}-${{ inputs.arch }}) + - name: Setup Node.js ${{ needs.get-configs.outputs.node-version }} (${{ runner.os }}-${{ runner.arch }}) uses: actions/setup-node@v4 with: node-version: ${{ needs.get-configs.outputs.node-version }} @@ -68,7 +68,7 @@ jobs: shell: bash run: echo "Building from branch=$(git rev-parse --abbrev-ref HEAD), commit=$(git rev-parse HEAD), tag=$(git describe --tags --exact-match)" - - name: Setup Go ${{ needs.get-configs.outputs.go-version }} (${{ inputs.runs-on }}-${{ inputs.arch }}) + - name: Setup Go ${{ needs.get-configs.outputs.go-version }} (${{ runner.os }}-${{ runner.arch }}) uses: actions/setup-go@v4 with: go-version: ${{ needs.get-configs.outputs.go-version }} diff --git a/.github/workflows/build-matrix.yml b/.github/workflows/build-matrix.yml index 927ff4b2..8375d8f0 100644 --- a/.github/workflows/build-matrix.yml +++ b/.github/workflows/build-matrix.yml @@ -19,10 +19,10 @@ jobs: JSON_STRING=$(cat <> $GITHUB_OUTPUT echo "is-prerelease=false" >> $GITHUB_OUTPUT - elif [[ "$TAG" =~ ^v$VERSION-[a-zA-Z0-9]+$ ]]; then + elif [[ "$TAG" =~ ^v$VERSION-(alpha|beta)$ ]]; then echo "tag=$TAG" >> $GITHUB_OUTPUT echo "is-prerelease=true" >> $GITHUB_OUTPUT else @@ -105,7 +106,10 @@ jobs: - name: Bundle shell: bash run: | - if [[ "${{ needs.version-and-tag.outputs.is-prerelease }}" == "true" ]]; then + TAG=${{ needs.version-and-tag.outputs.tag }} + if [[ "$TAG" =~ -alpha$ ]]; then + npm run bundle:alpha + elif [[ "$TAG" =~ -beta$ ]]; then npm run bundle:beta else npm run bundle:prod @@ -120,11 +124,20 @@ jobs: shell: bash run: | APP_NAME=${{ needs.get-configs.outputs.app-name }} - VERSION=${{ needs.version-and-tag.outputs.tag }} - OS=${{ matrix.name }} - ARCH=${{ matrix.arch }} - - ASSET_NAME="${APP_NAME}-${VERSION}-${OS}-${ARCH}.zip" + VERSION=$(node -p "require('./package.json').version") + OS=${{ runner.os }} + ARCH=${{ runner.arch }} + + TAG=${{ needs.version-and-tag.outputs.tag }} + if [[ "$TAG" =~ -alpha$ ]]; then + FILE_NAME="${APP_NAME}-${VERSION}-alpha-${OS}-${ARCH}.zip" + elif [[ "$TAG" =~ -beta$ ]]; then + FILE_NAME="${APP_NAME}-${VERSION}-beta-${OS}-${ARCH}.zip" + else + FILE_NAME="${APP_NAME}-${VERSION}-${OS}-${ARCH}.zip" + fi + + ASSET_NAME=$(echo "$FILE_NAME" | tr '[:upper:]' '[:lower:]') echo "ASSET_NAME=${ASSET_NAME}" echo "ASSET_NAME=${ASSET_NAME}" >> $GITHUB_OUTPUT diff --git a/webpack.config.js b/webpack.config.js index 46f27ca3..047b65f0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -135,7 +135,7 @@ function createPlugins(isDevelopment, outputPath, mode, env) { fs.writeFileSync(path.join(tmpDir, 'package.json'), JSON.stringify(tmpPkg, null, 2)); fs.copyFileSync('package-lock.json', `${tmpDir}/package-lock.json`); - execSync('npm ci', { cwd: tmpDir, stdio: 'inherit' }); + execSync('npm ci --only=prod', { cwd: tmpDir, stdio: 'inherit' }); callback(); } catch (error) { callback(error);