Skip to content

Commit

Permalink
ci: add nightly release job
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf authored and tiensonqin committed Dec 13, 2021
1 parent 13e3ee2 commit e1a7f6b
Showing 1 changed file with 125 additions and 15 deletions.
140 changes: 125 additions & 15 deletions .github/workflows/build-desktop-release.yml
Expand Up @@ -9,23 +9,23 @@ on:
description: 'Build Target ("nightly"/"beta")'
type: string
required: true
default: "nightly"
default: "beta"
git-ref:
description: "Release Git Ref"
description: "Release Git Ref(master)"
required: true
default: "master"
is-draft:
description: 'Draft Release? '
description: 'Draft Release? (will not be public)'
type: boolean
required: true
default: true
is-pre-release:
description: 'Pre Release?'
description: 'Pre Release? (labeled as "PreRelease")'
type: boolean
required: true
default: true
# schedule: # Every workday at the noon (UTC) we run a scheduled nightly build
# - cron: '0 12 * * MON-FRI'
schedule: # Every workday at the 2 P.M. (UTC) we run a scheduled nightly build
- cron: '0 14 * * MON-FRI'

env:
CLOJURE_VERSION: '1.10.1.763'
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
name: logseq-win64-builds
path: builds

build-macos:
build-macos-x64:
needs: [ compile-cljs ]
runs-on: macos-11

Expand Down Expand Up @@ -277,8 +277,61 @@ jobs:
mv static/out/make/Logseq.dmg ./builds/Logseq-darwin-x64-${{ steps.ref.outputs.version }}.dmg
mv static/out/make/zip/darwin/x64/*.zip ./builds/Logseq-darwin-x64-${{ steps.ref.outputs.version }}.zip
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: logseq-darwin-x64-builds
path: builds

build-macos-arm64:
needs: [ compile-cljs ]
runs-on: macos-11

steps:
- name: Download The Static Asset
uses: actions/download-artifact@v2
with:
name: static
path: static

- name: Retrieve tag version
id: ref
run: |
pkgver=$(cat ./static/VERSION)
echo ::set-output name=version::$pkgver
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Cache yarn cache directory
uses: actions/cache@v2
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-arm64-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-arm64-yarn-
- name: Signing By Apple Developer ID
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.APPLE_CERTIFICATES_P12 }}
p12-password: ${{ secrets.APPLE_CERTIFICATES_P12_PASSWORD }}

# - name: Cache Node Modules
# uses: actions/cache@v2
# with:
# path: |
# **/node_modules
# key: ${{ runner.os }}-node-modules

- name: Build/Release Electron App for arm64
run: yarn electron:make-macos-arm64
run: yarn install && yarn electron:make-macos-arm64
working-directory: ./static
env:
APPLE_ID: ${{ secrets.APPLE_ID_EMAIL }}
Expand All @@ -287,25 +340,82 @@ jobs:

- name: Save arm64 artifacts
run: |
mkdir -p builds
mv static/out/make/Logseq.dmg ./builds/Logseq-darwin-arm64-${{ steps.ref.outputs.version }}.dmg
mv static/out/make/zip/darwin/arm64/*.zip ./builds/Logseq-darwin-arm64-${{ steps.ref.outputs.version }}.zip
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: logseq-darwin-builds
name: logseq-darwin-arm64-builds
path: builds

nightly-release:
if: ${{ github.event_name == 'schedule' || github.event.inputs.build-target == 'nightly' }}
needs: [ build-macos-x64, build-macos-arm64, build-linux, build-windows ]
runs-on: ubuntu-18.04
steps:
- name: Download MacOS x64 Artifacts
uses: actions/download-artifact@v2
with:
name: logseq-darwin-x64-builds
path: ./

- name: Download MacOS arm64 Artifacts
uses: actions/download-artifact@v2
with:
name: logseq-darwin-arm64-builds
path: ./

- name: Download The Linux Artifacts
uses: actions/download-artifact@v2
with:
name: logseq-linux-builds
path: ./

- name: Download The Windows Artifact
uses: actions/download-artifact@v2
with:
name: logseq-win64-builds
path: ./

- name: List files
run: ls -rl

- name: Update Nightly Release
uses: andelf/nightly-release@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: nightly
name: 'Desktop App Nightly Relase $$'
draft: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.is-draft) || false }}
prerelease: ${{ (github.event_name == 'workflow_dispatch' && github.event.inputs.is-pre-release) || (github.event_name == 'schedule')}}
body: "This is a nightly release of the Logseq desktop app."
files: |
./VERSION
./SHA256SUMS.txt
./*.zip
./*.dmg
./*.exe
./*.AppImage
release:
# NOTE: For now, we only have beta channel to be released on Github
if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'beta') }}
needs: [ build-macos, build-linux, build-windows ]
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.build-target != 'nightly' }}
needs: [ build-macos-x64, build-macos-arm64, build-linux, build-windows ]
runs-on: ubuntu-18.04
steps:
- name: Download MacOS Artifacts
- name: Download MacOS x64 Artifacts
uses: actions/download-artifact@v2
with:
name: logseq-darwin-x64-builds
path: ./

- name: Download MacOS arm64 Artifacts
uses: actions/download-artifact@v2
with:
name: logseq-darwin-builds
name: logseq-darwin-arm64-builds
path: ./

- name: Download The Linux Artifacts
Expand Down Expand Up @@ -344,8 +454,8 @@ jobs:
tag_name: ${{ steps.ref.outputs.version }}
name: Desktop APP ${{ steps.ref.outputs.version }} (Beta Testing)
body: "TODO: Fill this changelog. Sorry for the inconvenience!"
draft: ${{ github.event.inputs.is-draft == true || github.event_name == 'schedule' }}
prerelease: ${{ github.event.inputs.is-pre-release == true || github.event_name == 'schedule' }}
draft: ${{ github.event.inputs.is-draft }}
prerelease: ${{ github.event.inputs.is-pre-release }}
files: |
./VERSION
./SHA256SUMS.txt
Expand Down

0 comments on commit e1a7f6b

Please sign in to comment.