From 878cebea884b3278a7a39c3381f5b4bf11921eca Mon Sep 17 00:00:00 2001 From: Julian Alarcon Date: Tue, 19 Sep 2023 11:54:57 +0200 Subject: [PATCH] build: simplify build configuration --- .../{release.yml => build-release.yml} | 34 +++++++++++++++- .github/workflows/snap.yml | 40 ------------------- package.json | 12 +++--- 3 files changed, 39 insertions(+), 47 deletions(-) rename .github/workflows/{release.yml => build-release.yml} (71%) delete mode 100644 .github/workflows/snap.yml diff --git a/.github/workflows/release.yml b/.github/workflows/build-release.yml similarity index 71% rename from .github/workflows/release.yml rename to .github/workflows/build-release.yml index 07a531c..bb3d1b6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/build-release.yml @@ -1,4 +1,4 @@ -name: Build/release +name: Build & Release on: [push] @@ -6,7 +6,7 @@ env: GH_TOKEN: ${{ SECRETS.GITHUB_TOKEN }} jobs: - release: + gitlab-release: runs-on: ${{ matrix.os }} # Platforms to build on/for @@ -75,3 +75,33 @@ jobs: github.ref == 'refs/heads/main' && startsWith(matrix.os, 'windows') run: yarn dist:windows -- --publish always + snap-release: + runs-on: ubuntu-latest + strategy: + matrix: + arch: [x64, armv7l] + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} + + steps: + - name: Check out Git repository + uses: actions/checkout@v3 + + - name: Install Node.js, NPM and Yarn + uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Build + run: yarn --link-duplicates --pure-lockfile + + - name: Install Snapcraft + uses: samuelmeuli/action-snapcraft@v2 + + - name: Build for test only + if: github.ref != 'refs/heads/main' + run: yarn dist:linux:snap:${{ matrix.arch }} --publish never + + - name: Release + if: github.ref == 'refs/heads/main' + run: yarn dist:linux:snap:${{ matrix.arch }} --publish always diff --git a/.github/workflows/snap.yml b/.github/workflows/snap.yml deleted file mode 100644 index 122406d..0000000 --- a/.github/workflows/snap.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Build/release for Snap - -on: push - -defaults: - run: - shell: bash - -jobs: - snap: - runs-on: ubuntu-latest - strategy: - matrix: - arch: [x64, armv7l] - env: - SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} - GH_TOKEN: ${{ SECRETS.GITHUB_TOKEN }} - - steps: - - name: Check out Git repository - uses: actions/checkout@v3 - - - name: Install Node.js, NPM and Yarn - uses: actions/setup-node@v3 - with: - node-version: 20 - - - name: Build - run: yarn --link-duplicates --pure-lockfile - - - name: Install Snapcraft - uses: samuelmeuli/action-snapcraft@v2 - - - name: Build for test only - if: github.ref != 'refs/heads/main' - run: yarn dist:linux:snap:${{ matrix.arch }} --publish never - - - name: Release - if: github.ref == 'refs/heads/main' - run: yarn dist:linux:snap:${{ matrix.arch }} --publish always diff --git a/package.json b/package.json index 2451c25..912ecdb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "prospect-mail", "productName": "Prospect Mail", - "version": "0.5.0-beta1", + "version": "0.5.0-beta2", "main": "src/main.js", "description": "Unofficial desktop client for Microsoft Outlook", "homepage": "https://github.com/julian-alarcon/prospect-mail", @@ -57,9 +57,9 @@ "dist:linux:targz": "electron-builder --x64 --arm64 --armv7l -l tar.gz", "dist:mac": "electron-builder --mac", "dist:windows": "electron-builder --windows --x64", - "dist:linux:x64": "electron-builder --x64 -l AppImage deb pacman rpm tar.gz", + "dist:linux:x64": "electron-builder --x64 -l AppImage deb pacman rpm snap tar.gz", "dist:linux:arm64": "electron-builder --arm64 -l AppImage deb pacman rpm tar.gz", - "dist:linux:arm": "electron-builder --armv7l -l AppImage deb pacman rpm tar.gz", + "dist:linux:arm": "electron-builder --armv7l -l AppImage deb pacman rpm snap tar.gz", "release": "electron-builder", "postinstall": "electron-builder install-app-deps" }, @@ -116,8 +116,10 @@ "upower-observe" ], "publish": [ - "github", - "snapStore" + { + "provider": "snapStore", + "channels": "beta" + } ], "allowNativeWayland": true },