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

140 lines
3.9 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:
tag-name:
description: "Release Tag Name"
required: true
git-ref:
description: "Release Git Ref"
required: true
2021-01-29 08:43:57 +00:00
jobs:
2021-02-01 07:17:13 +00:00
build-linux:
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
- 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
- name: Build/release Electron app
run: yarn install && yarn release-electron
- name: List files
run: du -a static/out
2021-02-01 08:00:03 +00:00
- name: Change artifact name
run: mv static/out/make/zip/linux/x64/logseq-linux-x64-*.zip static/out/make/zip/linux/x64/Logseq-linux.zip
- name: Cache Artifact
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
2021-02-01 07:47:27 +00:00
build-windows:
runs-on: windows-latest
steps:
- name: List file
run: Dir .
2021-02-01 07:17:13 +00:00
build-macos:
runs-on: macos-latest
2021-01-29 08:43:57 +00:00
steps:
2021-02-01 08:18:33 +00:00
- name: Check out Git Repository
2021-01-29 08:43:57 +00:00
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 14
2021-02-01 08:18:33 +00:00
- name: Install Brew & Clojure
2021-01-29 08:43:57 +00:00
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install clojure/tools/clojure
2021-02-01 08:18:33 +00:00
- name: Build/Release Electron app
2021-01-29 08:43:57 +00:00
run: yarn install && yarn release-electron
2021-02-01 08:18:33 +00:00
- name: Change Artifact Name
2021-02-01 08:39:04 +00:00
run: mv static/out/make/Logseq.dmg static/out/make/Logseq-x64.dmg
2021-02-01 08:00:03 +00:00
2021-02-01 07:17:13 +00:00
- name: Cache Artifact
uses: actions/upload-artifact@v1
with:
name: Logseq-x64.dmg
2021-02-01 08:39:04 +00:00
path: static/out/make/Logseq-x64.dmg
2021-02-01 07:17:13 +00:00
release:
needs: [ build-macos, build-linux, build-windows ]
runs-on: ubuntu-latest
steps:
2021-02-01 08:18:33 +00:00
- name: Download The MacOS X64 Asset
2021-02-01 07:17:13 +00:00
uses: actions/download-artifact@v1
with:
name: Logseq-x64.dmg
2021-02-01 08:00:03 +00:00
path: ./
2021-02-01 08:18:33 +00:00
- name: Download The Linux Asset
2021-02-01 08:00:03 +00:00
uses: actions/download-artifact@v1
with:
name: Logseq-linux.zip
path: ./
2021-02-01 07:17:13 +00:00
- name: List file
run: ls -rl
- name: Create Release Draft
2021-01-29 08:43:57 +00:00
id: create_release
uses: actions/create-release@v1
env:
2021-02-01 07:17:13 +00:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2021-01-29 08:43:57 +00:00
with:
2021-02-01 07:17:13 +00:00
tag_name: ${{ github.event.inputs.tag-name }}
release_name: TEST CI (DON'T DOWNLOAD) ${{ github.event.inputs.tag-name }}
2021-01-29 08:43:57 +00:00
draft: true
prerelease: true
2021-02-01 08:18:33 +00:00
- name: Upload MacOS X64 Artifact
2021-02-01 08:22:51 +00:00
id: upload-macos-x64-artifact
2021-01-29 08:43:57 +00:00
uses: actions/upload-release-asset@v1
2021-02-01 07:17:13 +00:00
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2021-01-29 08:43:57 +00:00
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
2021-02-01 07:17:13 +00:00
asset_path: ./Logseq-x64.dmg
asset_name: logseq-darwin-x64-${{ github.event.inputs.tag-name }}.dmg
2021-02-01 08:00:03 +00:00
asset_content_type: application/x-apple-diskimage
2021-02-01 08:18:33 +00:00
- name: Upload Linux Artifact
2021-02-01 08:22:51 +00:00
id: upload-linux-artifact
2021-02-01 08:00:03 +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-name }}.zip
asset_content_type: application/zip