chore(release): v1.9.5 #69
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: "Release" | |
on: | |
push: | |
tags: | |
- "v*" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
run-tests-and-linter: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- run: npm clean-install | |
- run: npm run lint | |
- run: npm run test | |
create-release: | |
needs: run-tests-and-linter | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
outputs: | |
release_id: ${{ steps.create-release.outputs.result }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Get version | |
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV | |
- name: Create release | |
id: create-release | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const fs = require('fs'); | |
const changelogContent = fs.readFileSync('changelog.md', 'utf-8'); | |
const regex = new RegExp(`(?<=\\[${process.env.PACKAGE_VERSION}\\]\\s)([\\s\\S]*?)(?=\\s## \\[)`, 'g'); | |
const releaseNotes = changelogContent.match(regex)?.[0].trim() || ''; | |
const { data } = await github.rest.repos.createRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
tag_name: `v${process.env.PACKAGE_VERSION}`, | |
name: `Seelen UI v${process.env.PACKAGE_VERSION}`, | |
body: releaseNotes, | |
generate_release_notes: true, | |
draft: true, | |
prerelease: false, | |
}); | |
return data.id; | |
build-installers: | |
needs: create-release | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- platform: "windows-latest" | |
args: "" | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Install Rust Nightly | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly-2024-06-25 | |
- name: Install frontend dependencies | |
run: npm install | |
- uses: tauri-apps/tauri-action@v0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} | |
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} | |
with: | |
releaseId: ${{ needs.create-release.outputs.release_id }} | |
args: ${{ matrix.args }} | |
- name: Install winget | |
if: matrix.platform == 'windows-latest' | |
uses: Cyberboss/install-winget@v1 | |
- name: Install MSIX dependencies | |
if: matrix.platform == 'windows-latest' | |
shell: powershell | |
run: | | |
winget install --id Microsoft.DotNet.AspNetCore.8 --accept-package-agreements --accept-source-agreements --force | |
winget install --id Microsoft.DotNet.DesktopRuntime.8 --accept-package-agreements --accept-source-agreements --force | |
winget install --id MarcinOtorowski.MSIXHero --accept-package-agreements --accept-source-agreements --force | |
- name: Bundle MSIX | |
if: matrix.platform == 'windows-latest' | |
run: npx ts-node scripts/bundle.msix.ts | |
- name: Upload artifacts | |
id: artifact-upload-step | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-bundle | |
path: target/release/bundle | |
- name: Output artifact ID | |
run: echo 'Artifact ID is ${{ steps.artifact-upload-step.outputs.artifact-id }}' | |
microsoft-store-submission: | |
needs: build-installers | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-bundle | |
path: target/release/bundle | |
# Use Store Broker to publish to Microsoft Store | |
- name: Submit to Partner Center (aka DevCenter) | |
shell: pwsh | |
run: | | |
./scripts/SubmitToStore.ps1 | |
env: | |
PartnerCenterStoreId: ${{ secrets.MS_PRODUCT_ID }} | |
PartnerCenterTenantId: ${{ secrets.MS_TENANT_ID }} | |
PartnerCenterClientId: ${{ secrets.MS_CLIENT_ID }} | |
PartnerCenterClientSecret: ${{ secrets.MS_CLIENT_SECRET }} | |
SBDisableTelemetry: true | |
publish-release: | |
needs: [build-installers, create-release] | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Publish release | |
uses: actions/github-script@v7 | |
env: | |
releaseId: ${{ needs.create-release.outputs.release_id }} | |
with: | |
github-token: "${{ secrets.GITHUB_TOKEN }}" | |
script: | | |
const result = await github.rest.repos.listReleaseAssets({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: process.env.releaseId, | |
}); | |
result.data.forEach(async (asset) => { | |
if (asset.name.endsWith('.sig')) { | |
await github.rest.repos.deleteReleaseAsset({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
asset_id: asset.id, | |
}); | |
} | |
}); | |
await github.rest.repos.updateRelease({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
release_id: process.env.releaseId, | |
draft: false, | |
}); | |
discord: | |
needs: publish-release | |
name: Send Announcement To Discord Server | |
runs-on: ubuntu-latest | |
steps: | |
- name: Discord notification | |
uses: LeGitHubDeTai/github-to-discord@main | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
DISCORD_USERNAME: Seelen | |
DISCORD_AVATAR: https://raw.githubusercontent.com/eythaann/Seelen-UI/master/documentation/images/logo_with_margins.png | |
AUTHOR_NAME: eythaann | |
AUTHOR_URL: "https://github.com/eythaann" | |
AUTHOR_AVATAR: "https://avatars.githubusercontent.com/u/76607907?v=4" | |
MESSAGE_TITLE: Seelen UI | |
MESSAGE_DESCRIPTION: A new release of Seelen UI has been published | |
MESSAGE_COLOR: 5814783 | |
SECTION_NAME: "ChangeLog" | |
FOOTER_TEXT: "Seelen Inc." | |
FOOTER_URL: "https://github.com/eythaann/seelen-ui" |