dbgate/.github/workflows/build-app.yaml

89 lines
2.4 KiB
YAML
Raw Normal View History

2020-03-15 20:10:38 +00:00
name: Electron app
on:
push:
2020-05-11 14:14:19 +00:00
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# branches:
# - production
2020-03-15 08:35:34 +00:00
2020-03-14 15:51:23 +00:00
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
2020-05-18 17:17:57 +00:00
# os: [ubuntu-18.04, windows-2016]
os: [macOS-10.14, windows-2016, ubuntu-18.04]
2020-03-14 15:51:23 +00:00
steps:
- name: Context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Use Node.js 10.x
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: yarn install
run: |
yarn install
2020-12-10 12:31:37 +00:00
- name: setCurrentVersion
run: |
yarn setCurrentVersion
2020-03-15 20:10:38 +00:00
- name: Publish
2020-03-14 15:51:23 +00:00
run: |
2020-03-15 20:10:38 +00:00
yarn run build:app
2020-03-15 19:42:29 +00:00
2020-03-15 21:10:48 +00:00
- name: Copy artifacts Linux, MacOs
2020-03-15 19:42:29 +00:00
if: matrix.os != 'windows-2016'
2020-03-14 15:51:23 +00:00
run: |
2020-03-15 19:42:29 +00:00
mkdir artifacts
2020-05-11 14:43:52 +00:00
mv app/dist/*.deb artifacts/dbgate-linux.deb || true
mv app/dist/*.AppImage artifacts/dbgate-linux.AppImage || true
mv app/dist/*.dmg artifacts/dbgate-mac.dmg || true
2020-05-18 17:17:57 +00:00
mv app/dist/*.deb artifacts || true
mv app/dist/*.AppImage artifacts || true
mv app/dist/*.dmg artifacts || true
2020-05-11 14:43:52 +00:00
mv app/dist/latest.yml artifacts/latest.yml || true
2020-03-15 21:10:48 +00:00
- name: Copy artifacts Win
2020-03-15 19:42:29 +00:00
if: matrix.os == 'windows-2016'
run: |
mkdir artifacts
2020-05-11 14:43:52 +00:00
mv app/dist/*.exe artifacts/dbgate-windows.exe
2020-05-18 18:56:02 +00:00
mv app/dist/*.zip artifacts/dbgate-windows.zip
2020-05-18 17:17:57 +00:00
mv app/dist/*.exe artifacts || true
2020-03-15 19:42:29 +00:00
2020-03-15 20:10:38 +00:00
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}
2020-03-15 19:42:29 +00:00
path: artifacts
2020-05-11 14:14:19 +00:00
2020-03-15 20:10:38 +00:00
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
2020-03-15 19:42:29 +00:00
files: "artifacts/**"
2020-03-15 20:10:38 +00:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2021-01-07 08:01:37 +00:00
GH_TOKEN: ${{ secrets.GH_TOKEN }} # token for electron publish
2020-05-11 14:14:19 +00:00
# - name: Create 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: false