Skip to content

Release

Release #44

Workflow file for this run

name: Release
on:
#push:
# tags:
# - "v*.*.*"
workflow_dispatch:
inputs:
tag:
type: string
description: Release tag
required: true
jobs:
build-ubuntu:
name: Build the repository on Ubuntu
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Use Node.js 18
uses: actions/[email protected]
with:
cache: 'npm'
node-version: 18
- name: Update npm
run: sudo npm install -g npm
- name: Install electron
run: sudo npm install -g electron --unsafe-perm=true --allow-root
- name: Install npm packages
run: sudo npm ci
- name: Install dpkg, fakeroot and rpm
run: |
sudo apt-get update -y
sudo apt-get install -y dpkg fakeroot rpm
- name: Provide 777 execution rights to clipboard handler script
run: |
sudo chmod 777 node_modules/clipboard-event/platform/clipboard-event-handler-linux
sudo chmod 777 node_modules/clipboard-event/platform/clipboard-event-handler-mac
- name: Set NODE_ENV to 'production'
run: export NODE_ENV=production
- name: Make
run: sudo npm run make --if-present
- run: sudo tree . -I 'node_modules|japreader-linux-x64'
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: japReader-artifacts ubuntu-latest
path: out/make/
retention-days: 1
build-windows:
name: Build the repository on Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Use Node.js 18
uses: actions/[email protected]
with:
cache: 'npm'
node-version: 18
- name: Update npm
run: npm install -g npm
- name: Install npm packages
run: npm ci
- name: Set NODE_ENV to 'production'
run: SET NODE_ENV=production
- name: Make
run: npm run make --if-present
- run: tree .
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: japReader-artifacts windows-latest
path: out/make/
retention-days: 1
release:
name: Create a new github release ${{ inputs.tag }}
permissions:
contents: write
runs-on: ubuntu-latest
needs: [build-ubuntu, build-windows]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Download Linux Build Artifacts
uses: actions/[email protected]
with:
name: japReader-artifacts ubuntu-latest
path: make/
- name: Download Windows Build Artifacts
uses: actions/[email protected]
with:
name: japReader-artifacts windows-latest
path: make/
- name: Get Release body from CHANGELOG.md
run: sed -e '/^$/,$d' CHANGELOG.md > CHANGELOG-${{ inputs.tag }}.md
- run: tree .
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG-${{ inputs.tag }}.md
files: |
make/deb/x64/*.deb
make/rpm/x64/*.rpm
make/zip/linux/x64/*.zip
make/zip/win32/x64/*.zip
make/squirrel.windows/x64/*.exe
Anki_japReader.apkg
tag_name: ${{ inputs.tag }}