dbgate/.github/workflows/build-app.yaml
2020-12-10 13:31:37 +01:00

88 lines
2.3 KiB
YAML

name: Electron app
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
# branches:
# - production
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-18.04, windows-2016]
os: [macOS-10.14, windows-2016, ubuntu-18.04]
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
- name: setCurrentVersion
run: |
yarn setCurrentVersion
- name: Publish
run: |
yarn run build:app
- name: Copy artifacts Linux, MacOs
if: matrix.os != 'windows-2016'
run: |
mkdir artifacts
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
mv app/dist/*.deb artifacts || true
mv app/dist/*.AppImage artifacts || true
mv app/dist/*.dmg artifacts || true
mv app/dist/latest.yml artifacts/latest.yml || true
- name: Copy artifacts Win
if: matrix.os == 'windows-2016'
run: |
mkdir artifacts
mv app/dist/*.exe artifacts/dbgate-windows.exe
mv app/dist/*.zip artifacts/dbgate-windows.zip
mv app/dist/*.exe artifacts || true
- name: Upload artifacts
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}
path: artifacts
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: "artifacts/**"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - 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