Skip to content

Commit

Permalink
chore(release): version 0.47.5 (#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
ci010 committed Oct 13, 2024
1 parent 2b60e9f commit f01c6ec
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 22 deletions.
24 changes: 17 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,37 +63,47 @@ jobs:
name: sourcemap
path: |
xmcl-electron-app/dist/*.js.map
- name: Upload Build
- name: Upload Unsigned Appx
if: ${{ runner.os == 'Windows' && startsWith(github.event.head_commit.message, 'chore(release)') }}
id: upload-artifact
uses: actions/upload-artifact@v4
with:
name: build-${{ runner.os }}
name: appx
path: |
xmcl-electron-app/build/output/
xmcl-electron-app/build/output/*.appx
- name: Sign Build
if: ${{ runner.os == 'Windows' && startsWith(github.event.head_commit.message, 'chore(release)') }}
id: sign
uses: signpath/github-action-submit-signing-request@v0.4
continue-on-error: true
with:
api-token: ${{ secrets.CODE_SIGN_TOKEN }}
organization-id: ab51b40d-a5bd-4d25-ae54-66ccabf86161
project-slug: x-minecraft-launcher
signing-policy-slug: release-signing
github-artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
artifact-configuration-slug: build
artifact-configuration-slug: appx
wait-for-completion: true
output-artifact-directory: xmcl-electron-app/build/output/
- name: Check Sign Status
id: sign-status
if: ${{ runner.os == 'Windows' && startsWith(github.event.head_commit.message, 'chore(release)') }}
run: |
if ("${{ steps.sign.outcome }}" -eq "success") {
echo "SIGN_SUCCESS=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} else {
echo "SIGN_SUCCESS=false" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
- name: Update Signed Sha256
if: ${{ runner.os == 'Windows' && startsWith(github.event.head_commit.message, 'chore(release)') }}
run: |
pnpm postsign
- name: Upload Signed Build
if: ${{ runner.os == 'Windows' && startsWith(github.event.head_commit.message, 'chore(release)') }}
- name: Upload Build
uses: actions/upload-artifact@v4
with:
name: build-${{ runner.os }}
path: |
xmcl-electron-app/build/output/
overwrite: true
- name: Upload Windows Zip Build
if: ${{ runner.os == 'Windows' }}
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.47.4",
"version": "0.47.5",
"private": true,
"license": "MIT",
"packageManager": "pnpm@9.3.0",
Expand Down
2 changes: 1 addition & 1 deletion xmcl-electron-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "xmcl",
"private": true,
"main": "./index.js",
"version": "0.47.4",
"version": "0.47.5",
"author": "ci010 <cijhn@hotmail.com>",
"description": "A great minecraft launcher in the future",
"license": "MIT",
Expand Down
32 changes: 21 additions & 11 deletions xmcl-electron-app/postsign.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,25 @@
import { readdirSync, readFileSync, writeFileSync } from 'fs'
import { readdirSync, readFileSync, writeFileSync, unlinkSync } from 'fs'
import { createHash } from 'crypto'
const success = process.env.SIGN_SUCCESS

const files = readdirSync('./build/output')
const toUpdate = files.filter((file) => file.endsWith('.appx') || file.endsWith('.zip'))
if (success) {
const files = readdirSync('./build/output')
const toUpdate = files.filter((file) => file.endsWith('.appx') || file.endsWith('.zip'))

for (const file of toUpdate) {
const hash = createHash('sha256')
const content = readFileSync(`./build/output/${file}`)
hash.update(content)
const digest = hash.digest('hex')
const sha256File = `./build/output/${file}.sha256`
writeFileSync(sha256File, digest)
console.log(`Wrote sha256 hash to ${file} -> ${sha256File} = ${digest}`)
for (const file of toUpdate) {
const hash = createHash('sha256')
const content = readFileSync(`./build/output/${file}`)
hash.update(content)
const digest = hash.digest('hex')
const sha256File = `./build/output/${file}.sha256`
writeFileSync(sha256File, digest)
console.log(`Wrote sha256 hash to ${file} -> ${sha256File} = ${digest}`)
}
} else {
// remove appx
const files = readdirSync('./build/output')
const toDelete = files.filter((file) => file.endsWith('.appx') || file.endsWith('.appinstaller'))
for (const f of toDelete) {
unlinkSync(`./build/output/${f}`)
}
}
2 changes: 1 addition & 1 deletion xmcl-keystone-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": true,
"type": "module",
"productName": "xmcl",
"version": "0.46.1",
"version": "0.46.2",
"author": "ci010 <cijhn@hotmail.com>",
"description": "A great minecraft launcher in the future",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion xmcl-runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@xmcl/runtime",
"private": true,
"version": "0.44.4",
"version": "0.44.5",
"author": "ci010 <cijhn@hotmail.com>",
"description": "The runtime for x minecraft launcher in nodejs",
"license": "MIT",
Expand Down

0 comments on commit f01c6ec

Please sign in to comment.