logseq/.github/workflows/build-desktop-release.yml

330 lines
10 KiB
YAML
Raw Normal View History

2021-01-29 08:43:57 +00:00
# This is a basic workflow to help you get started with Actions
name: Build-Desktop-Release
on:
workflow_dispatch:
2021-02-01 07:17:13 +00:00
inputs:
2021-02-01 14:17:42 +00:00
tag-version:
description: "Release Tag Version"
2021-02-01 07:17:13 +00:00
required: true
git-ref:
description: "Release Git Ref"
required: true
default: "master"
is-draft:
description: 'Draft Release? '
required: true
default: "true"
is-pre-release:
description: 'Pre Release?'
required: true
default: "true"
2021-01-29 08:43:57 +00:00
jobs:
2021-02-01 10:33:14 +00:00
compile-cljs:
2021-02-01 07:17:13 +00:00
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
2021-01-29 08:43:57 +00:00
2021-02-01 07:50:22 +00:00
- name: Setup Java JDK
uses: actions/setup-java@v1.4.3
with:
java-version: 1.8
2021-02-02 05:30:20 +00:00
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven
2021-02-01 07:50:22 +00:00
- name: Install clojure
run: |
curl -O https://download.clojure.org/install/linux-install-1.10.1.763.sh
chmod +x linux-install-1.10.1.763.sh
sudo ./linux-install-1.10.1.763.sh
2021-02-01 08:54:59 +00:00
- name: Compile CLJS
run: yarn install --frozen-lockfile && gulp build && yarn cljs:release
2021-02-01 08:54:59 +00:00
2021-02-01 14:17:42 +00:00
- name: Update APP Version
run: |
sed -i 's/"version": "0.0.1"/"version": "${{ github.event.inputs.tag-version }}"/g' ./package.json
working-directory: ./static
2021-02-02 03:17:42 +00:00
- name: Update OSX Packager Config
run: |
2021-02-02 05:23:49 +00:00
sed -i 's/appleId: "my-fake-apple-id"/appleId: "${{ secrets.APPLE_ID_EMAIL }}"/' ./forge.config.js
sed -i 's/appleIdPassword: "my-fake-apple-id-password"/appleIdPassword: "${{ secrets.APPLE_ID_PASSWORD }}"/' ./forge.config.js
2021-02-02 03:17:42 +00:00
working-directory: ./static
2021-02-01 15:05:04 +00:00
- name: Display Package.json
2021-02-01 14:17:42 +00:00
run: cat ./package.json
working-directory: ./static
2021-02-01 15:05:04 +00:00
- name: List Files
run: ls -al
working-directory: ./static
- name: Compress Static Files
2021-02-01 08:54:59 +00:00
run: zip -r static.zip ./static
- name: Cache Static File
uses: actions/upload-artifact@v1
with:
name: static.zip
path: static.zip
2021-02-01 07:50:22 +00:00
2021-02-01 10:33:14 +00:00
build-linux:
runs-on: ubuntu-latest
needs: [ compile-cljs ]
steps:
2021-02-01 15:05:04 +00:00
- name: Download The Static Asset
2021-02-01 10:33:14 +00:00
uses: actions/download-artifact@v1
with:
name: static.zip
path: ./
2021-02-01 15:05:04 +00:00
- name: Uncompress Static FIles
2021-02-01 10:33:14 +00:00
run: unzip static.zip
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
2021-02-02 01:58:39 +00:00
- name: Cache Node Modules
uses: actions/cache@v2
with:
path: |
**/node_modules
2021-02-02 05:33:30 +00:00
key: ${{ runner.os }}-node-modules
2021-02-02 01:58:39 +00:00
2021-02-01 15:05:04 +00:00
- name: Build/Release Electron App
run: yarn install --frozen-lockfile && yarn electron:make
2021-02-01 08:54:59 +00:00
working-directory: ./static
2021-02-01 07:50:22 +00:00
- name: Change Artifact Name For ZIP File
2021-04-30 15:59:12 +00:00
run: mv static/out/make/zip/linux/x64/*-linux-x64-*.zip static/out/make/zip/linux/x64/Logseq-linux.zip
2021-02-01 08:00:03 +00:00
- name: Change Artifact Name For AppImage File
2021-04-30 15:59:12 +00:00
run: mv static/out/make/*-*.AppImage static/out/make/Logseq-linux.AppImage
- name: Cache Artifact With ZIP format
2021-02-01 08:00:03 +00:00
uses: actions/upload-artifact@v1
with:
name: Logseq-linux.zip
path: static/out/make/zip/linux/x64/Logseq-linux.zip
2021-02-01 07:17:13 +00:00
- name: Cache Artifact With AppImage format
uses: actions/upload-artifact@v1
with:
name: Logseq-linux.AppImage
path: static/out/make/Logseq-linux.AppImage
2021-02-01 10:05:11 +00:00
build-windows:
runs-on: windows-latest
2021-02-01 10:33:14 +00:00
needs: [ compile-cljs ]
2021-02-01 10:05:11 +00:00
steps:
2021-02-01 15:05:04 +00:00
- name: Download The Static Asset
2021-02-01 10:05:11 +00:00
uses: actions/download-artifact@v1
with:
name: static.zip
path: ./
2021-02-01 15:05:04 +00:00
- name: Uncompress Static FIles
2021-02-01 10:05:11 +00:00
run: unzip static.zip
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
2021-02-02 02:38:00 +00:00
- name: Cache Node Modules
uses: actions/cache@v2
with:
path: |
**/node_modules
2021-02-02 05:33:30 +00:00
key: ${{ runner.os }}-node-modules
2021-02-02 02:38:00 +00:00
2021-02-01 15:05:04 +00:00
- name: Build/Release Electron app
run: yarn install --frozen-lockfile && yarn electron:make
2021-02-01 10:05:11 +00:00
working-directory: ./static
2021-02-01 11:45:41 +00:00
- name: Change Artifact Name
2021-02-01 13:08:28 +00:00
run: Get-ChildItem static\out\make\squirrel.windows\x64\*.exe | Rename-Item -NewName Logseq-win64.exe
2021-02-01 11:45:41 +00:00
2021-02-01 15:05:04 +00:00
- name: List Directory
2021-02-01 11:45:41 +00:00
run: dir
working-directory: static/out/make/squirrel.windows/x64/
2021-02-01 07:47:27 +00:00
2021-02-01 11:45:41 +00:00
- name: Cache Artifact
uses: actions/upload-artifact@v1
with:
2021-02-01 13:22:57 +00:00
name: Logseq-win64.exe
2021-02-01 13:08:28 +00:00
path: static/out/make/squirrel.windows/x64/Logseq-win64.exe
2021-02-01 07:47:27 +00:00
2021-02-01 07:17:13 +00:00
build-macos:
2021-02-01 10:33:14 +00:00
needs: [ compile-cljs ]
2021-02-01 07:17:13 +00:00
runs-on: macos-latest
2021-01-29 08:43:57 +00:00
steps:
2021-02-01 15:05:04 +00:00
- name: Download The Static Asset
2021-02-01 08:54:59 +00:00
uses: actions/download-artifact@v1
with:
2021-02-01 10:05:11 +00:00
name: static.zip
path: ./
2021-02-01 08:54:59 +00:00
2021-02-01 15:05:04 +00:00
- name: Uncompress Static Files
2021-02-01 10:05:11 +00:00
run: unzip ./static.zip
2021-02-01 08:54:59 +00:00
2021-02-01 15:05:04 +00:00
- name: List Static Files
2021-02-01 08:54:59 +00:00
run: ls -al ./static
2021-01-29 08:43:57 +00:00
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
2021-02-02 01:58:39 +00:00
- name: Signing By Apple Developer ID
uses: apple-actions/import-codesign-certs@v1
2021-02-02 01:23:31 +00:00
with:
p12-file-base64: ${{ secrets.APPLE_CERTIFICATES_P12 }}
p12-password: ${{ secrets.APPLE_CERTIFICATES_P12_PASSWORD }}
2021-02-02 01:58:39 +00:00
- name: Cache Node Modules
uses: actions/cache@v2
with:
path: |
**/node_modules
2021-02-02 05:33:30 +00:00
key: ${{ runner.os }}-node-modules
2021-02-02 01:58:39 +00:00
2021-02-01 15:05:04 +00:00
- name: Build/Release Electron App
run: yarn install --frozen-lockfile && yarn electron:make
2021-02-01 08:54:59 +00:00
working-directory: ./static
2021-01-29 08:43:57 +00:00
2021-02-03 09:25:00 +00:00
- name: Change DMG Name
2021-04-30 15:59:12 +00:00
run: mv static/out/make/*.dmg static/out/make/logseq-darwin-x64-${{ github.event.inputs.tag-version }}.dmg
2021-02-03 09:25:00 +00:00
- name: Cache Artifact DMG
2021-02-01 07:17:13 +00:00
uses: actions/upload-artifact@v1
with:
name: Logseq-x64.dmg
2021-02-03 09:25:00 +00:00
path: static/out/make/logseq-darwin-x64-${{ github.event.inputs.tag-version }}.dmg
- name: Cache Artifact ZIP
uses: actions/upload-artifact@v1
with:
name: Logseq-x64.zip
2021-04-30 16:10:17 +00:00
path: static/out/make/zip/darwin/x64/*-darwin-x64-${{ github.event.inputs.tag-version }}.zip
2021-02-01 07:17:13 +00:00
2021-02-01 13:08:28 +00:00
release:
needs: [ build-macos, build-linux, build-windows ]
runs-on: ubuntu-latest
steps:
2021-02-03 09:25:00 +00:00
- name: Download The MacOS X64 DMG Artifact
2021-02-01 13:08:28 +00:00
uses: actions/download-artifact@v1
with:
name: Logseq-x64.dmg
path: ./
2021-02-03 09:25:00 +00:00
- name: Download The MacOS X64 ZIP Artifact
uses: actions/download-artifact@v1
with:
name: Logseq-x64.zip
path: ./
- name: Download The Linux Artifact In Zip format
2021-02-01 13:08:28 +00:00
uses: actions/download-artifact@v1
with:
name: Logseq-linux.zip
path: ./
- name: Download The Linux Artifact In AppImage format
uses: actions/download-artifact@v1
with:
name: Logseq-linux.AppImage
path: ./
2021-02-01 15:05:04 +00:00
- name: Download The Windows Artifact
2021-02-01 13:08:28 +00:00
uses: actions/download-artifact@v1
with:
name: Logseq-win64.exe
path: ./
2021-02-01 15:05:04 +00:00
- name: List files
2021-02-01 13:08:28 +00:00
run: ls -rl
- name: Create Release Draft
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2021-02-01 14:17:42 +00:00
tag_name: ${{ github.event.inputs.tag-version }}
2021-02-02 06:14:09 +00:00
release_name: Desktop APP ${{ github.event.inputs.tag-version }} (Alpha Testing)
draft: ${{ github.event.inputs.is-draft }}
prerelease: ${{ github.event.inputs.is-pre-release }}
2021-02-01 13:08:28 +00:00
2021-02-03 09:25:00 +00:00
- name: Upload MacOS X64 ZIP Artifact
id: upload-macos-x64-zip-artifact
2021-02-01 13:08:28 +00:00
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
2021-02-03 06:39:53 +00:00
asset_path: ./logseq-darwin-x64-${{ github.event.inputs.tag-version }}.zip
asset_name: logseq-darwin-x64-${{ github.event.inputs.tag-version }}.zip
2021-02-03 06:39:53 +00:00
asset_content_type: application/zip
2021-02-01 13:08:28 +00:00
2021-02-03 09:25:00 +00:00
- name: Upload MacOS X64 DMG Artifact
id: upload-macos-x64-dmg-artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./logseq-darwin-x64-${{ github.event.inputs.tag-version }}.dmg
asset_name: logseq-darwin-x64-${{ github.event.inputs.tag-version }}.dmg
2021-02-03 09:25:00 +00:00
asset_content_type: application/x-apple-diskimage
- name: Upload Linux Artifact With Zip format
id: upload-linux-artifact-with-zip-format
2021-02-01 13:08:28 +00:00
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Logseq-linux.zip
asset_name: logseq-linux-x64-${{ github.event.inputs.tag-version }}.zip
2021-02-01 13:08:28 +00:00
asset_content_type: application/zip
- name: Upload Linux Artifact With AppImage format
id: upload-linux-artifact-with-appimage-format
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Logseq-linux.AppImage
asset_name: logseq-linux-x64-${{ github.event.inputs.tag-version }}.AppImage
asset_content_type: application/octet-stream
2021-02-01 13:08:28 +00:00
- name: Upload Windows Artifact
id: upload-win-artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./Logseq-win64.exe
asset_name: logseq-win-x64-${{ github.event.inputs.tag-version }}.exe
2021-02-05 15:34:25 +00:00
asset_content_type: application/octet-stream