Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Add Continuous Delivery #145

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -29,6 +29,7 @@
"appId": "org.ooni.probe-desktop",
"productName": "OONI Probe",
"asar": true,
"artifactName": "${productName}.${ext}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is useful to have the version number in filename.

"files": [
"**/*",
"!bin",
Expand All @@ -37,6 +38,7 @@
],
"linux": {
"target": [
"AppImage",
"deb",
"rpm",
"tar.gz"
Expand Down