Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 40 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,49 @@
# Builds and tests pushes to main and pull requests. Only pushes to main retain the installer artifact.
# Also called directly by sync/release: a GITHUB_TOKEN push does not trigger CI.
name: build
on:
push:
branches: [main]
pull_request:
workflow_call:
inputs:
ref:
type: string
required: true
outputs:
artifact:
value: ${{ jobs.build.outputs.artifact }}
commit:
value: ${{ jobs.build.outputs.commit }}

permissions:
contents: read

jobs:
build:
runs-on: windows-latest
outputs:
artifact: WinRust-${{ steps.source.outputs.commit }}
commit: ${{ steps.source.outputs.commit }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref || github.sha }}
persist-credentials: false
- id: source
shell: pwsh
run: '"commit=$(git rev-parse HEAD)" >> $env:GITHUB_OUTPUT'
- uses: actions/setup-node@v4
with:
node-version: '22'
- uses: dtolnay/rust-toolchain@stable
- name: Check translations and VN update configuration
run: |
node --test scripts/check-translations.test.mjs scripts/release.test.mjs scripts/maintenance.test.mjs
if ($LASTEXITCODE) { exit $LASTEXITCODE }
node scripts/check-translations.mjs
if ($LASTEXITCODE) { exit $LASTEXITCODE }
node scripts/check-release-config.mjs
if ($LASTEXITCODE) { exit $LASTEXITCODE }
- uses: Swatinem/rust-cache@v2
with:
workspaces: |
Expand All @@ -22,8 +56,10 @@ jobs:
- name: Test rust-search
run: cargo test
working-directory: plugins/rust-search
- name: Name the installer
run: Copy-Item -LiteralPath target/release/plugin-launcher.exe -Destination target/release/WinRust.exe
- uses: actions/upload-artifact@v4
if: github.event_name == 'push'
with:
name: WinRust
path: target/release/plugin-launcher.exe
name: WinRust-${{ steps.source.outputs.commit }}
path: target/release/WinRust.exe
if-no-files-found: error
64 changes: 64 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Release WinRust-VN
on:
workflow_dispatch:
inputs:
notes:
description: Release notes (optional)
type: string
default: ''
workflow_call:
inputs:
ref:
required: true
type: string
secrets:
WINRUST_SIGNING_KEY_HEX:
required: true

permissions:
contents: read

concurrency:
group: vn-release
cancel-in-progress: false

jobs:
build:
uses: ./.github/workflows/build.yml
with:
ref: ${{ inputs.ref || github.sha }}
publish:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ needs.build.outputs.commit }}
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: '22'
- name: Require tested main revision
env:
GH_TOKEN: ${{ github.token }}
TESTED_SHA: ${{ needs.build.outputs.commit }}
run: |
test "$GITHUB_REPOSITORY" = 'iamtayky/WinRust-VN'
MAIN_SHA=$(gh api repos/iamtayky/WinRust-VN/git/ref/heads/main --jq .object.sha)
test "$MAIN_SHA" = "$TESTED_SHA"
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build.outputs.artifact }}
path: release
- name: Sign and verify manifest
env:
WINRUST_SIGNING_KEY_HEX: ${{ secrets.WINRUST_SIGNING_KEY_HEX }}
run: node scripts/sign-release.mjs release
- name: Publish verified assets
env:
GH_TOKEN: ${{ github.token }}
RELEASE_NOTES: ${{ inputs.notes || '' }}
run: node scripts/publish-release.mjs
73 changes: 73 additions & 0 deletions .github/workflows/sync-upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Sync upstream and release VN
on:
schedule:
- cron: '17 1 * * *' # 08:17 Vietnam time
workflow_dispatch:

permissions:
contents: read

concurrency:
group: vn-maintenance
cancel-in-progress: false

jobs:
prepare:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
changed: ${{ steps.sync.outputs.changed }}
head: ${{ steps.sync.outputs.head }}
base: ${{ steps.sync.outputs.base }}
pr: ${{ steps.sync.outputs.pr }}
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '22'
- id: sync
env:
GH_TOKEN: ${{ github.token }}
run: node scripts/sync-upstream.mjs
validate:
needs: prepare
if: needs.prepare.outputs.changed == 'true'
uses: ./.github/workflows/build.yml
with:
ref: ${{ needs.prepare.outputs.head }}
merge:
needs: [prepare, validate]
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
outputs:
commit: ${{ steps.merge.outputs.commit }}
steps:
- id: merge
env:
GH_TOKEN: ${{ github.token }}
BASE_SHA: ${{ needs.prepare.outputs.base }}
HEAD_SHA: ${{ needs.prepare.outputs.head }}
PR_NUMBER: ${{ needs.prepare.outputs.pr }}
run: |
CURRENT=$(gh api repos/iamtayky/WinRust-VN/git/ref/heads/main --jq .object.sha)
test "$CURRENT" = "$BASE_SHA"
gh pr merge "$PR_NUMBER" --repo iamtayky/WinRust-VN --merge --match-head-commit "$HEAD_SHA"
COMMIT=$(gh pr view "$PR_NUMBER" --repo iamtayky/WinRust-VN --json mergeCommit --jq .mergeCommit.oid)
test -n "$COMMIT"
echo "commit=$COMMIT" >> "$GITHUB_OUTPUT"
release:
needs: merge
permissions:
contents: write
uses: ./.github/workflows/release.yml
with:
ref: ${{ needs.merge.outputs.commit }}
secrets:
WINRUST_SIGNING_KEY_HEX: ${{ secrets.WINRUST_SIGNING_KEY_HEX }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ target/
*.log
.claude/
CLAUDE.md
/.tools/
/.serena/
/release/
*.key
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "plugin-launcher"
version = "0.7.1"
version = "0.7.2"
edition = "2024"
license = "MIT OR Apache-2.0"

Expand Down
Loading