-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- use commit hash as build version - fix macOS build warning
- Loading branch information
1 parent
a077b85
commit 4f756c0
Showing
7 changed files
with
121 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Package | ||
|
||
on: | ||
push: | ||
# DEBUG testing-only - remove all but main | ||
branches: [main, 412-main-artifact] | ||
workflow_dispatch: | ||
inputs: | ||
debug_enabled: | ||
type: boolean | ||
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)' | ||
required: false | ||
default: false | ||
|
||
jobs: | ||
publish: | ||
name: Main on ${{ matrix.os }}, .Net ${{ matrix.dotnet_version }}, node ${{ matrix.node_version }} | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-latest] | ||
dotnet_version: [7.0.x] | ||
node_version: [18.x] | ||
|
||
steps: | ||
- name: Checkout git repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{matrix.dotnet_version}} | ||
|
||
- name: Install Node and NPM | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
cache: npm | ||
|
||
- name: Install and build | ||
run: | | ||
npm install | ||
npm run build | ||
- name: Update release version | ||
run: | | ||
COMMIT_HASH=$(git rev-parse --short "$GITHUB_SHA") | ||
cd ./release/app | ||
CURRENT_VERSION=$(node -pe "require('./package.json').version") | ||
NEW_VERSION="${CURRENT_VERSION}-commit.${COMMIT_HASH}" | ||
echo "Updating version from ${CURRENT_VERSION} to ${NEW_VERSION}" | ||
npm version $NEW_VERSION | ||
- name: dotnet build - Windows on macOS | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
run: npm run build:data-release:windows | ||
|
||
- name: Publish releases - Windows and macOS | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
# env: | ||
# # These values are used for auto updates signing | ||
# APPLE_ID: ${{ secrets.APPLE_ID }} | ||
# APPLE_ID_PASS: ${{ secrets.APPLE_ID_PASS }} | ||
# CSC_LINK: ${{ secrets.CSC_LINK }} | ||
# CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | ||
run: | | ||
npm exec electron-builder -- build --publish never --win --mac | ||
- name: Publish releases - Linux | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
env: | ||
# no hardlinks so dependencies are copied | ||
USE_HARD_LINKS: false | ||
run: | | ||
npm exec electron-builder -- build --publish never --linux | ||
- name: Upload macOS artifacts | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: app-macos | ||
path: | | ||
./release/build/*.dmg | ||
- name: Upload Windows artifacts | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: app-windows | ||
path: | | ||
./release/build/*.exe | ||
!./release/build/*Setup*.exe | ||
- name: Upload Linux artifacts | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: app-linux | ||
path: | | ||
./release/build/*.AppImage | ||
# Enable tmate debugging of manually-triggered workflows if the input option was provided | ||
- name: Setup tmate session | ||
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | ||
uses: mxschmitt/action-tmate@v3 | ||
with: | ||
limit-access-to-actor: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters