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

121 lines
3.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:
2021-01-07 09:59:11 +00:00
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
2020-05-11 14:14:19 +00:00
# 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
2021-01-07 08:08:57 +00:00
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }} # token for electron publish
2020-03-15 19:42:29 +00:00
2021-01-07 09:41:32 +00:00
- name: Copy artifacts
2020-03-14 15:51:23 +00:00
run: |
2021-01-07 09:41:32 +00:00
mkdir artifacts
2021-01-07 09:10:56 +00:00
2021-01-07 09:59:11 +00:00
cp app/dist/*.deb artifacts/dbgate-latest.deb || true
cp app/dist/*.AppImage artifacts/dbgate-latest.AppImage || true
cp app/dist/*.exe artifacts/dbgate-latest.exe || true
cp app/dist/*.dmg artifacts/dbgate-latest.dmg || true
2021-01-07 09:41:32 +00:00
mv app/dist/*.exe artifacts/ || true
mv app/dist/*.AppImage artifacts/ || true
mv app/dist/*.deb artifacts/ || true
mv app/dist/*.dmg artifacts/ || true
2021-01-07 09:10:56 +00:00
2021-01-07 09:41:32 +00:00
# - name: Copy artifacts Linux, MacOs
# if: matrix.os != 'windows-2016'
# run: |
# mkdir artifacts
# cp app/dist/*.AppImage artifacts/ || true
# cp app/dist/*.dmg artifacts/ || true
# cp app/dist/*.deb artifacts/ || true
# 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
2021-01-07 09:59:11 +00:00
2021-01-07 09:41:32 +00:00
# - name: Copy artifacts Win
# if: matrix.os == 'windows-2016'
# run: |
# mkdir artifacts
2021-01-07 09:10:56 +00:00
2021-01-07 09:59:11 +00:00
# cp app/dist/*.exe artifacts/ || true
2021-01-07 09:10:56 +00:00
2021-01-07 09:41:32 +00:00
# mv app/dist/*.exe artifacts/dbgate-windows.exe
2020-05-18 17:17:57 +00:00
2021-01-07 09:41:32 +00:00
# mv app/dist/latest.yml artifacts/latest.yml || true
2020-03-15 19:42:29 +00:00
2021-01-07 09:59:11 +00:00
- name: Copy latest.yml (windows)
if: matrix.os == 'windows-2016'
run: |
mv app/dist/latest.yml artifacts/latest.yml || true
- name: Copy latest-linux.yml
if: matrix.os == 'ubuntu-18.04'
run: |
mv app/dist/latest-linux.yml artifacts/latest-linux.yml || true
- name: Copy latest-mac.yml
if: matrix.os == 'macOS-10.14'
run: |
mv app/dist/latest-mac.yml artifacts/latest-mac.yml || true
2021-01-07 08:30:40 +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:
2021-01-07 09:59:11 +00:00
files: 'artifacts/**'
2020-03-15 20:10:38 +00:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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
2021-01-07 09:59:11 +00:00
# prerelease: false