Skip to content

Commit

Permalink
release build
Browse files Browse the repository at this point in the history
  • Loading branch information
dewmal committed May 29, 2024
1 parent 86803d3 commit b6068c6
Show file tree
Hide file tree
Showing 3 changed files with 232 additions and 0 deletions.
107 changes: 107 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: CI job

on:
push:
branches-ignore:
- crowdin
paths-ignore:
- "**/*.md"
pull_request:
branches-ignore:
- crowdin
paths-ignore:
- "**/*.md"

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
timeout-minutes: 30

steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Cache npm packages
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Cache Node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: add git binaries to PATH
if: runner.os == 'Windows'
run: |
echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files\Git\mingw64\libexec\git-core" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: install setup tools
if: runner.os == 'macOS'
run: |
sudo -H pip install setuptools
- run: npm ci
- run: npm run lint
- run: npm test

build:
runs-on: ${{ matrix.platform.os }}
needs: tests
strategy:
matrix:
platform:
[
{ os: "ubuntu-latest", cmd: "build:linux" },
{ os: "macos-11", cmd: "build:macos" },
{ os: "windows-latest", cmd: "build:windows" },
]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: get-npm-version
id: package-version
uses: pchynoweth/[email protected]
- name: Cache npm packages
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- name: Cache Node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: add git binaries to PATH
if: runner.os == 'Windows'
run: |
echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files\Git\mingw64\libexec\git-core" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: install setup tools
if: runner.os == 'macOS'
run: |
sudo -H pip install setuptools
- run: npm ci
- run: npm run ${{ matrix.platform.cmd }}
shell: bash
env:
VERSION: ${{ steps.package-version.outputs.version}}
125 changes: 125 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Release job

on: workflow_dispatch

jobs:
linux_release:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@master
- name: get-npm-version
id: package-version
uses: pchynoweth/[email protected]
- name: Use Node.js 20
uses: actions/setup-node@master
with:
version: 20
cache: npm
- run: npm ci
- run: npm run build:linux
shell: bash
env:
VERSION: ${{ steps.package-version.outputs.version }}
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: nuclear-binaries-linux
path: release/*.*
- name: Create a release
uses: softprops/action-gh-release@v1
with:
name: v${{ steps.package-version.outputs.version }}
tag_name: v${{ steps.package-version.outputs.version }}
prerelease: true
files: release/*.*
- name: Inform AUR updater
uses: peter-evans/repository-dispatch@v1
with:
repository: NuclearPlayer/nuclear-nightly-aur
token: ${{ secrets.REPO_ACCESS_TOKEN }}
event-type: release
client-payload: '{"tag": "v${{ steps.package-version.outputs.version }}"}'
- name: Inform Snapcraft updater
uses: peter-evans/repository-dispatch@v1
with:
repository: NuclearPlayer/nuclear-nightly-snapcraft
token: ${{ secrets.REPO_ACCESS_TOKEN }}
event-type: release
client-payload: '{"tag": "v${{ steps.package-version.outputs.version }}"}'
- name: Inform Flatpak updater
uses: peter-evans/repository-dispatch@v1
with:
repository: NuclearPlayer/nuclear-nightly-flatpak
token: ${{ secrets.REPO_ACCESS_TOKEN }}
event-type: release
client-payload: '{"tag": "v${{ steps.package-version.outputs.version }}"}'

mac_release:
runs-on: macos-11
timeout-minutes: 30

steps:
- uses: actions/checkout@master
- name: get-npm-version
id: package-version
uses: pchynoweth/[email protected]
- name: Use Node.js 20
uses: actions/setup-node@master
with:
version: 20
cache: npm
- run: npm ci
- run: npm run build:macos
shell: bash
env:
VERSION: ${{ steps.package-version.outputs.version }}
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: nuclear-binaries-mac
path: release/*.*
- name: Create a release
uses: softprops/action-gh-release@v1
with:
name: v${{ steps.package-version.outputs.version }}
tag_name: v${{ steps.package-version.outputs.version }}
prerelease: true
files: release/*.*

windows_release:
runs-on: windows-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@master
- name: get-npm-version
id: package-version
uses: pchynoweth/[email protected]
- name: Use Node.js 20
uses: actions/setup-node@master
with:
version: 20
cache: npm
- name: add git binaries to PATH
run: |
echo "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "C:\Program Files\Git\mingw64\libexec\git-core" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- run: npm ci
- run: npm run build:windows
shell: bash
env:
VERSION: ${{ steps.package-version.outputs.version }}
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: nuclear-binaries-windows
path: release/*.*
- name: Create a release
uses: softprops/action-gh-release@v1
with:
name: v${{ steps.package-version.outputs.version }}
tag_name: v${{ steps.package-version.outputs.version }}
prerelease: true
files: release/*.*
Binary file removed libpdf.node
Binary file not shown.

0 comments on commit b6068c6

Please sign in to comment.