Titan v1.2.17 Release #25
Workflow file for this run
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
name: Build and Publish Titan Electron App | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
release: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# os: [macos-latest, ubuntu-latest, windows-latest] | |
os: [windows-latest] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # Important for generating the changelog | |
# Cache Node.js dependencies | |
- name: Cache Node Modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Use Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: "18" | |
- name: Install Dependencies | |
run: npm ci | |
- name: Generate Changelog | |
id: changelog | |
shell: pwsh | |
run: | | |
$PreviousTag = git describe --tags --abbrev=0 HEAD^ 2>$null | |
if (-not $PreviousTag) { | |
$Changelog = git log --pretty=format:"- %s" | |
} else { | |
$Changelog = git log --pretty=format:"- %s" "$PreviousTag..HEAD" | |
} | |
$Changelog = $Changelog -join "`n" | |
"CHANGELOG<<EOF" >> $env:GITHUB_OUTPUT | |
$Changelog >> $env:GITHUB_OUTPUT | |
"EOF" >> $env:GITHUB_OUTPUT | |
- name: Create Draft Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Titan ${{ github.ref }} | |
body: | | |
## Changelog: | |
${{ steps.changelog.outputs.CHANGELOG }} | |
draft: true | |
prerelease: false | |
- name: Build and Publish Electron App | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
shell: pwsh | |
run: | | |
if ("${{ matrix.os }}" -eq "windows-latest") { | |
npm run publish:win | |
} elseif ("${{ matrix.os }}" -eq "macos-latest") { | |
npm run publish:mac | |
} else { | |
npm run publish:linux | |
} |