Skip to content

Commit

Permalink
Merge pull request #10 from ObsidianLabs/develop
Browse files Browse the repository at this point in the history
ci: add Github Actions
  • Loading branch information
qftgtr authored Jul 25, 2020
2 parents 2a6a834 + 496e379 commit e6d21cd
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Build

on:
release:
types: [published]

jobs:
bump:
runs-on: ubuntu-18.04

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: master
fetch-depth: 0

- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF##*[\/v]}
shell: bash

- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 12

- name: Bump version
working-directory: .
run: |
yarn config set version-git-tag false
yarn version --new-version ${{ steps.get_version.outputs.VERSION }}
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git diff-index --quiet HEAD || git commit -am 'v${{ steps.get_version.outputs.VERSION }}'
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: master

release:
needs: bump

# Platforms to build on/for
strategy:
matrix:
os: [macos-latest, ubuntu-18.04]

runs-on: ${{ matrix.os }}

steps:
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 12

- name: Checkout electron-components
uses: actions/checkout@v2
with:
repository: ObsidianLabs/electron-components
ref: master
path: ./electron-components

- name: Build electron-components
working-directory: ./electron-components
run: yarn && yarn build

- name: Checkout ckb-components
uses: actions/checkout@v2
with:
repository: ObsidianLabs/ckb-components
ref: master
path: ./ckb-components

- name: Install ckb-components submodule
working-directory: ./ckb-components
run: git submodule update --init

- name: Build ckb-components
working-directory: ./ckb-components
run: yarn && yarn build

- name: Checkout Studio
uses: actions/checkout@v2
with:
ref: master
path: ./studio

- name: Build studio
uses: ObsidianLabs/studio-build-action@master
with:
build: ckb
project_name: CKB Studio
build_script: yarn && yarn dist
working-directory: ./studio
fontawesome_token: ${{ secrets.fontawesome_token }}
mac_certs: ${{ secrets.certs }}
mac_certs_password: ${{ secrets.certs_password }}
windows_certs: ${{ secrets.certs }}
windows_certs_password: ${{ secrets.certs_password }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload assets
uses: AButler/upload-release-assets@v2.0
with:
files: 'studio/dist/*.(dmg|zip|exe|AppImage|yml)'
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit e6d21cd

Please sign in to comment.