diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 00000000..70b4c2d5 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,91 @@ +name: Publish +on: + push: + tags: + - v* + pull_request: + tags: + - v* + +jobs: + publish_linux: + name: Publish Linux Builds + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-18.04] + node-version: [12.x] + + steps: + - uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + + - uses: actions/cache@v1 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) + with: + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + - name: Install + run: yarn install --frozen-lockfile + + - name: Build + env: + LANG: en + run: yarn run build + + - name: Package linux + run: yarn run pack:linux + + - name: Create a (pre)release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'beta') }} + + - name: Upload AppImage + id: upload_appimage + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: "./dist/OONI Probe.AppImage" + asset_name: "OONI Probe.AppImage" + asset_content_type: application/x-executable + + - name: Upload Deb + id: upload_deb + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: "./dist/OONI Probe.deb" + asset_name: "OONI-Probe.deb" + asset_content_type: application/vnc.debian.binary-package + + - name: Upload RPM + id: upload_rpm + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: "./dist/OONI Probe.rpm" + asset_name: "OONI-Probe.rpm" + asset_content_type: application/x-rpm diff --git a/Readme.md b/Readme.md index 6a068885..9dc7bdd0 100644 --- a/Readme.md +++ b/Readme.md @@ -71,6 +71,7 @@ the auto-update system will try to fetch the metadata associated with that tag. You can also make a build, but not publish it by running the following commands: ``` +yarn build yarn run pack:mac yarn run pack:win yarn run pack:linux diff --git a/package.json b/package.json index 5a359549..abfb455c 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,10 @@ "dev": "yarn run start", "build": "next build renderer && next export renderer && yarn run probe-cli", "dist": "yarn run build && electron-builder --dir -mw", - "pack": "yarn run build && electron-builder --win --mac --linux", - "pack:win": "yarn run build && electron-builder --win --x64", - "pack:mac": "yarn run build && electron-builder --mac", - "pack:linux": "yarn run build && electron-builder --linux", + "pack": "electron-builder --win --mac --linux", + "pack:win": "electron-builder --win --x64 -p never", + "pack:mac": "electron-builder --mac -p never", + "pack:linux": "electron-builder --linux -p never", "probe-cli": "node scripts/download-bin.js", "publish": "yarn run build && electron-builder --mac --win -p always", "icon-gen": "icon-gen -i static/Icon-Color.svg -o main/static/icons -r -m ico,icns", @@ -29,6 +29,7 @@ "appId": "org.ooni.probe-desktop", "productName": "OONI Probe", "asar": true, + "artifactName": "${productName}.${ext}", "files": [ "**/*", "!bin", @@ -37,6 +38,7 @@ ], "linux": { "target": [ + "AppImage", "deb", "rpm", "tar.gz"