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

158 lines
4.9 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-23 09:33:20 +00:00
- 'v[0-9]+.[0-9]+.[0-9]+'
# - '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]
2021-05-20 14:13:31 +00:00
os: [macOS-10.15, 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"
2021-09-28 06:15:08 +00:00
- uses: actions/checkout@v2
2020-03-14 15:51:23 +00:00
with:
fetch-depth: 1
- name: Use Node.js 14.x
2020-03-14 15:51:23 +00:00
uses: actions/setup-node@v1
with:
node-version: 14.x
2020-03-14 15:51:23 +00:00
- name: yarn install
run: |
yarn install
2020-12-10 12:31:37 +00:00
- name: setCurrentVersion
run: |
yarn setCurrentVersion
2021-01-17 08:11:09 +00:00
- name: fillNativeModulesElectron
run: |
yarn fillNativeModulesElectron
- name: fillPackagedPlugins
run: |
yarn fillPackagedPlugins
2021-01-19 19:43:15 +00:00
- name: Install Snapcraft
if: matrix.os == 'ubuntu-18.04'
uses: samuelmeuli/action-snapcraft@v1
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
2021-01-12 17:24:24 +00:00
WIN_CSC_LINK: ${{ secrets.WINCERT_CERTIFICATE }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WINCERT_PASSWORD }}
2020-03-15 19:42:29 +00:00
2021-01-07 15:29:01 +00:00
- name: generatePadFile
run: |
yarn generatePadFile
2021-01-19 19:56:24 +00:00
- name: Save snap login
if: matrix.os == 'ubuntu-18.04'
run: 'echo "$SNAPCRAFT_LOGIN" > snapcraft.login'
shell: bash
env:
SNAPCRAFT_LOGIN: ${{secrets.SNAPCRAFT_LOGIN}}
2021-01-19 19:43:15 +00:00
- name: publishSnap
if: matrix.os == 'ubuntu-18.04'
run: |
snapcraft login --with snapcraft.login
2021-01-21 09:34:17 +00:00
snapcraft upload --release=stable app/dist/*.snap
2021-01-19 19:43:15 +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
2021-05-22 07:28:21 +00:00
cp app/dist/*x86*.AppImage artifacts/dbgate-latest.AppImage || true
cp app/dist/*arm64*.AppImage artifacts/dbgate-latest-arm64.AppImage || true
cp app/dist/*armv7l*.AppImage artifacts/dbgate-latest-armv7l.AppImage || true
2021-01-07 09:59:11 +00:00
cp app/dist/*.exe artifacts/dbgate-latest.exe || true
2021-09-16 11:03:56 +00:00
cp app/dist/*win_x64.zip artifacts/dbgate-windows-latest.zip || true
cp app/dist/*win_arm64.zip artifacts/dbgate-windows-latest-arm64.zip || true
2021-05-23 19:41:36 +00:00
cp app/dist/*-mac.dmg artifacts/dbgate-latest.dmg || true
cp app/dist/*-mac_arm64.dmg artifacts/dbgate-latest-arm64.dmg || true
2021-01-07 09:59:11 +00:00
2021-01-07 09:41:32 +00:00
mv app/dist/*.exe artifacts/ || true
2021-04-24 07:12:30 +00:00
mv app/dist/*.zip artifacts/ || true
2021-01-07 09:41:32 +00:00
mv app/dist/*.AppImage artifacts/ || true
mv app/dist/*.deb artifacts/ || true
mv app/dist/*.dmg artifacts/ || true
2021-01-19 19:43:15 +00:00
mv app/dist/*.snap artifacts/dbgate-latest.snap || 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
2021-01-07 16:01:14 +00:00
mv app/dist/dbgate-pad.xml artifacts/ || true
2021-01-07 09:59:11 +00:00
- 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
2021-05-20 14:13:31 +00:00
if: matrix.os == 'macOS-10.15'
2021-01-07 09:59:11 +00:00
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