From bc30ed41e8a7d5bcc7ac2afedb8d964793e9fba7 Mon Sep 17 00:00:00 2001 From: windvex Date: Mon, 20 Oct 2025 21:53:53 +0700 Subject: [PATCH 1/3] ci: mirror release assets to dist + publish Pages; refactor Deploy.vue to use CORS-friendly mirrors --- .github/workflows/mirror-assets.yml | 41 +++++++++++++++++++++++++++++ .github/workflows/pages.yml | 29 ++++++++++++++++++++ dist/.gitkeep | 0 3 files changed, 70 insertions(+) create mode 100644 .github/workflows/mirror-assets.yml create mode 100644 .github/workflows/pages.yml create mode 100644 dist/.gitkeep diff --git a/.github/workflows/mirror-assets.yml b/.github/workflows/mirror-assets.yml new file mode 100644 index 0000000..aa2f0a3 --- /dev/null +++ b/.github/workflows/mirror-assets.yml @@ -0,0 +1,41 @@ +name: Mirror Release Assets to Repo + +on: + release: + types: [published] + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Download release assets + uses: robinraju/release-downloader@v1.10 + with: + repository: ${{ github.repository }} + tag: ${{ github.event.release.tag_name }} + fileName: "token.*" + out-file-path: "mirror_tmp" + useLatestRelease: false + + - name: Prepare dist folder + run: | + V="${{ github.event.release.tag_name }}" + mkdir -p dist/token.wind/${V} dist/token.wind/latest + cp mirror_tmp/token.abi dist/token.wind/${V}/token.abi + cp mirror_tmp/token.wasm dist/token.wind/${V}/token.wasm + cp mirror_tmp/token.abi dist/token.wind/latest/token.abi + cp mirror_tmp/token.wasm dist/token.wind/latest/token.wasm + (cd dist/token.wind/${V} && sha256sum token.* | tee SHA256SUMS.txt) + + - name: Commit & push + run: | + V="${{ github.event.release.tag_name }}" + git config user.name "windvex-bot" + git config user.email "bot@windvex" + git add dist/ + git commit -m "chore(dist): mirror assets for ${V}" + git push diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..8bf70e3 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,29 @@ +name: Publish to GitHub Pages +on: + push: + branches: [main] + paths: + - 'dist/**' + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/upload-pages-artifact@v3 + with: + path: 'dist' + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/dist/.gitkeep b/dist/.gitkeep new file mode 100644 index 0000000..e69de29 From 4624da7a35f23e18a75abd2c1a1b86d2beccbbdd Mon Sep 17 00:00:00 2001 From: windvex Date: Mon, 20 Oct 2025 21:56:18 +0700 Subject: [PATCH 2/3] ci: mirror release assets to dist + publish Pages; refactor Deploy.vue to use CORS-friendly mirrors --- src/pages/Deploy.vue | 444 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 444 insertions(+) create mode 100644 src/pages/Deploy.vue diff --git a/src/pages/Deploy.vue b/src/pages/Deploy.vue new file mode 100644 index 0000000..943325a --- /dev/null +++ b/src/pages/Deploy.vue @@ -0,0 +1,444 @@ +// src/pages/Deploy.vue (refactor: fetch ABI/WASM from CORS-friendly mirrors with fallback) + + + From 63b5a5b6a61540a9b0f3417f4f319d4571efc8bd Mon Sep 17 00:00:00 2001 From: windvex Date: Mon, 20 Oct 2025 21:59:40 +0700 Subject: [PATCH 3/3] ci: allow manual run for mirror-assets --- .github/workflows/mirror-assets.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/mirror-assets.yml b/.github/workflows/mirror-assets.yml index aa2f0a3..448a7a6 100644 --- a/.github/workflows/mirror-assets.yml +++ b/.github/workflows/mirror-assets.yml @@ -1,5 +1,10 @@ name: Mirror Release Assets to Repo +on: + release: + types: [published] + workflow_dispatch: {} + on: release: types: [published]