This repository was archived by the owner on May 25, 2025. It is now read-only.
|α| Publish Alpha #4
This file contains hidden or 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
| # This Source Code Form is subject to the terms of the Mozilla Public | |
| # License, v. 2.0. If a copy of the MPL was not distributed with this | |
| # file, You can obtain one at http://mozilla.org/MPL/2.0/. | |
| name: "(A) |α| Publish Alpha" | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| run-name: "|α| Publish Alpha" | |
| jobs: | |
| main: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Retrieve run ID for Windows | |
| run: | | |
| WINDOWS_ID=$(curl -s \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| "https://api.github.com/repos/Floorp-Projects/Floorp-12/actions/workflows/package.yml/runs?branch=main&status=success" \ | |
| | jq -r '[.workflow_runs[] | select(.display_title | endswith("Windows-x64"))][0].id') | |
| echo "WINDOWS_RUN_ID=$WINDOWS_ID" >> $GITHUB_ENV | |
| - name: Retrieve run ID for Linux | |
| run: | | |
| LINUX_ID=$(curl -s \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| "https://api.github.com/repos/Floorp-Projects/Floorp-12/actions/workflows/package.yml/runs?branch=main&status=success" \ | |
| | jq -r '[.workflow_runs[] | select(.display_title | endswith("Linux-x64"))][0].id') | |
| echo "LINUX_RUN_ID=$LINUX_ID" >> $GITHUB_ENV | |
| - name: Retrieve run ID for macOS | |
| run: | | |
| MAC_ID=$(curl -s \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
| "https://api.github.com/repos/Floorp-Projects/Floorp-12/actions/workflows/package.yml/runs?branch=main&status=success" \ | |
| | jq -r '[.workflow_runs[] | select(.display_title | endswith("macOS-x64"))][0].id') | |
| echo "MAC_RUN_ID=$MAC_ID" >> $GITHUB_ENV | |
| - name: Download Windows artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: noraneko-win-amd64-mar-full | |
| run-id: ${{ env.WINDOWS_RUN_ID }} | |
| path: ~/noraneko-publish/win | |
| github-token: ${{ github.token }} | |
| - name: Download Linux artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: noraneko-linux-amd64-mar-full | |
| run-id: ${{ env.LINUX_RUN_ID }} | |
| path: ~/noraneko-publish/linux | |
| github-token: ${{ github.token }} | |
| - name: Download macOS artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: noraneko-mac-universal-mar-full | |
| run-id: ${{ env.MAC_RUN_ID }} | |
| path: ~/noraneko-publish/mac | |
| github-token: ${{ github.token }} | |
| - name: Download Windows installer | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: noraneko-win-amd64-installer | |
| run-id: ${{ env.WINDOWS_RUN_ID }} | |
| path: ~/noraneko-publish/win-dist | |
| github-token: ${{ github.token }} | |
| - name: Download Linux installer | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: noraneko-linux-amd64-installer | |
| run-id: ${{ env.LINUX_RUN_ID }} | |
| path: ~/noraneko-publish/linux-dist | |
| github-token: ${{ github.token }} | |
| - name: Download macOS installer | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: noraneko-mac-universal-installer | |
| run-id: ${{ env.MAC_RUN_ID }} | |
| path: ~/noraneko-publish/mac-dist | |
| github-token: ${{ github.token }} | |
| - name: Setup | |
| run: | | |
| pnpm i | |
| sudo apt install jq | |
| node --import @swc-node/register/esm-register ./scripts/update/xml.ts ~/noraneko-publish/win/meta.json ~/noraneko-publish/win/WINNT_x86_64-msvc-x64.update.xml | |
| node --import @swc-node/register/esm-register ./scripts/update/xml.ts ~/noraneko-publish/linux/meta.json ~/noraneko-publish/linux/Linux_x86_64.update.xml | |
| node --import @swc-node/register/esm-register ./scripts/update/xml.ts ~/noraneko-publish/mac/meta.json ~/noraneko-publish/mac/Darwin_x86_64.update.xml | |
| echo "VERSION=$(cat ~/noraneko-publish/win/meta.json | jq '.version' | sed 's/\"//g')" >> "$GITHUB_ENV" | |
| echo "NR_VERSION=$(cat ~/noraneko-publish/win/meta.json | jq '.noraneko_version' | sed 's/\"//g')" >> "$GITHUB_ENV" | |
| echo "ROOT_DIR=$(echo ~)" >> "$GITHUB_ENV" | |
| - name: Deploy to GitHub Releases 🚀 | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| ${{ env.ROOT_DIR }}/noraneko-publish/win/*.mar | |
| ${{ env.ROOT_DIR }}/noraneko-publish/win/*.xml | |
| ${{ env.ROOT_DIR }}/noraneko-publish/win-dist/** | |
| ${{ env.ROOT_DIR }}/noraneko-publish/linux/*.mar | |
| ${{ env.ROOT_DIR }}/noraneko-publish/linux/*.xml | |
| ${{ env.ROOT_DIR }}/noraneko-publish/linux-dist/** | |
| ${{ env.ROOT_DIR }}/noraneko-publish/mac/*.mar | |
| ${{ env.ROOT_DIR }}/noraneko-publish/mac/*.xml | |
| ${{ env.ROOT_DIR }}/noraneko-publish/mac-dist/** | |
| tag_name: "alpha" | |
| name: "Alpha Release" | |
| body: "Noraneko Alpha for Windows, Linux, and macOS" | |
| draft: false | |
| prerelease: true | |
| token: ${{ github.token }} | |
| - name: Publish Package 🎁 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: noraneko-publish | |
| path: ~/noraneko-publish/* |