Skip to content

1.7.4

1.7.4 #46

Workflow file for this run

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@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- run: npm clean-install
- run: npm run lint
- run: npm run test
create-release:
permissions:
contents: write
runs-on: ubuntu-latest
needs: run-tests-and-linter
outputs:
release_id: ${{ steps.create-release.outputs.result }}
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- 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 + "\n",
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
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- 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
uses: actions/upload-artifact@v2
with:
name: build-bundle
path: ./target/release/bundle
microsoft-store-submission:
needs: build-installers
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Download Artifacts
uses: actions/download-artifact@v2
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,
});