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:
|
2022-04-14 15:19:03 +00:00
|
|
|
fail-fast: false
|
2020-03-14 15:51:23 +00:00
|
|
|
matrix:
|
2023-03-06 18:11:47 +00:00
|
|
|
# os: [ubuntu-22.04, windows-2016]
|
2023-05-26 16:18:40 +00:00
|
|
|
os: [macos-12, windows-2022, ubuntu-22.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
|
2024-05-08 08:27:35 +00:00
|
|
|
- name: Use Node.js 18.x
|
2020-03-14 15:51:23 +00:00
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
2024-05-08 08:27:35 +00:00
|
|
|
node-version: 18.x
|
2022-08-07 08:02:11 +00:00
|
|
|
- name: yarn adjustPackageJson
|
|
|
|
run: |
|
|
|
|
yarn adjustPackageJson
|
2023-01-28 15:32:55 +00:00
|
|
|
- name: yarn set timeout
|
|
|
|
run: |
|
|
|
|
yarn config set network-timeout 100000
|
2020-03-14 15:51:23 +00:00
|
|
|
- name: yarn install
|
|
|
|
run: |
|
2022-02-18 05:36:47 +00:00
|
|
|
# yarn --version
|
|
|
|
# yarn config set network-timeout 300000
|
2020-03-14 15:51:23 +00:00
|
|
|
yarn install
|
2020-12-10 12:31:37 +00:00
|
|
|
- name: setCurrentVersion
|
|
|
|
run: |
|
|
|
|
yarn setCurrentVersion
|
2024-05-29 05:17:25 +00:00
|
|
|
- name: printSecrets
|
|
|
|
run: |
|
|
|
|
yarn printSecrets
|
|
|
|
env:
|
|
|
|
GIST_UPLOAD_SECRET : ${{secrets.GIST_UPLOAD_SECRET}}
|
2021-01-17 08:11:09 +00:00
|
|
|
- name: fillNativeModulesElectron
|
|
|
|
run: |
|
|
|
|
yarn fillNativeModulesElectron
|
2021-05-20 08:22:08 +00:00
|
|
|
- name: fillPackagedPlugins
|
|
|
|
run: |
|
|
|
|
yarn fillPackagedPlugins
|
2021-01-19 19:43:15 +00:00
|
|
|
- name: Install Snapcraft
|
2023-03-06 18:11:47 +00:00
|
|
|
if: matrix.os == 'ubuntu-22.04'
|
2021-01-19 19:43:15 +00:00
|
|
|
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
|
2022-04-14 14:52:10 +00:00
|
|
|
|
2022-11-12 19:17:21 +00:00
|
|
|
WIN_CSC_LINK: ${{ secrets.WINCERT_2025 }}
|
|
|
|
WIN_CSC_KEY_PASSWORD: ${{ secrets.WINCERT_2025_PASSWORD }}
|
|
|
|
# WIN_CSC_LINK: ${{ secrets.WINCERT_CERTIFICATE }}
|
|
|
|
# WIN_CSC_KEY_PASSWORD: ${{ secrets.WINCERT_PASSWORD }}
|
2022-04-14 14:52:10 +00:00
|
|
|
|
2022-04-14 11:48:52 +00:00
|
|
|
CSC_LINK: ${{ secrets.APPLECERT_CERTIFICATE }}
|
|
|
|
CSC_KEY_PASSWORD: ${{ secrets.APPLECERT_PASSWORD }}
|
2020-03-15 19:42:29 +00:00
|
|
|
|
2022-04-14 14:52:10 +00:00
|
|
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
2024-05-08 05:46:28 +00:00
|
|
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
2022-04-14 14:52:10 +00:00
|
|
|
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
|
|
|
|
2021-01-07 15:29:01 +00:00
|
|
|
- name: generatePadFile
|
|
|
|
run: |
|
|
|
|
yarn generatePadFile
|
|
|
|
|
2021-01-19 19:43:15 +00:00
|
|
|
- name: publishSnap
|
2023-03-06 18:11:47 +00:00
|
|
|
if: matrix.os == 'ubuntu-22.04'
|
2021-01-19 19:43:15 +00:00
|
|
|
run: |
|
2021-01-21 09:34:17 +00:00
|
|
|
snapcraft upload --release=stable app/dist/*.snap
|
2023-01-28 12:45:43 +00:00
|
|
|
env:
|
|
|
|
SNAPCRAFT_STORE_CREDENTIALS: ${{secrets.SNAPCRAFT_LOGIN}}
|
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
|
2022-04-14 14:03:33 +00:00
|
|
|
cp app/dist/*-mac_universal.dmg artifacts/dbgate-latest.dmg || true
|
2022-04-14 14:13:35 +00:00
|
|
|
cp app/dist/*-mac_x64.dmg artifacts/dbgate-latest-x64.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
|
2024-05-13 12:25:26 +00:00
|
|
|
mv app/dist/*.tar.gz 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)
|
2022-03-17 19:40:34 +00:00
|
|
|
if: matrix.os == 'windows-2022'
|
2021-01-07 09:59:11 +00:00
|
|
|
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
|
2023-03-06 18:11:47 +00:00
|
|
|
if: matrix.os == 'ubuntu-22.04'
|
2021-01-07 09:59:11 +00:00
|
|
|
run: |
|
|
|
|
mv app/dist/latest-linux.yml artifacts/latest-linux.yml || true
|
|
|
|
|
|
|
|
- name: Copy latest-mac.yml
|
2023-05-26 16:18:40 +00:00
|
|
|
if: matrix.os == 'macos-12'
|
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
|