This repository was archived by the owner on Sep 22, 2025. It is now read-only.
Update build-and-release.yml #2
Workflow file for this run
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
| name: Build and Release XenOS | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build XenOS | |
| run: | | |
| chmod +x ./scripts/build.sh | |
| ./scripts/build.sh | |
| - name: Create build archive | |
| run: | | |
| cd build | |
| zip -r ../xenos-build.zip ./* | |
| cd .. | |
| - name: Generate release notes | |
| run: | | |
| echo "## XenOS Build $(date '+%Y-%m-%d %H:%M:%S')" > release-notes.md | |
| echo "" >> release-notes.md | |
| echo "### Changes" >> release-notes.md | |
| echo "- Built from commit: \`${{ github.sha }}\`" >> release-notes.md | |
| echo "- Branch: \`${{ github.ref_name }}\`" >> release-notes.md | |
| echo "" >> release-notes.md | |
| echo "### Installation" >> release-notes.md | |
| echo "1. Download \`xenos-build.zip\`" >> release-notes.md | |
| echo "2. Extract the archive" >> release-notes.md | |
| echo "3. Serve the contents using a web server (e.g., \`npx serve\` or \`python -m http.server\`)" >> release-notes.md | |
| echo "4. Open the served URL in your browser" >> release-notes.md | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: XenOS ${{ github.ref_name }} | |
| body_path: release-notes.md | |
| files: | | |
| xenos-build.zip | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-dev: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/dev' && github.event_name == 'push' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'pnpm' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build XenOS | |
| run: | | |
| chmod +x ./scripts/build.sh | |
| ./scripts/build.sh | |
| - name: Create build archive | |
| run: | | |
| cd build | |
| zip -r ../xenos-dev-build.zip ./* | |
| cd .. | |
| - name: Generate dev release notes | |
| run: | | |
| echo "## XenOS Development Build" > dev-release-notes.md | |
| echo "" >> dev-release-notes.md | |
| echo "**⚠️ This is a development build and may be unstable**" >> dev-release-notes.md | |
| echo "" >> dev-release-notes.md | |
| echo "### Build Info" >> dev-release-notes.md | |
| echo "- Built from commit: \`${{ github.sha }}\`" >> dev-release-notes.md | |
| echo "- Branch: \`dev\`" >> dev-release-notes.md | |
| echo "- Build date: $(date '+%Y-%m-%d %H:%M:%S UTC')" >> dev-release-notes.md | |
| echo "" >> dev-release-notes.md | |
| echo "### Installation" >> dev-release-notes.md | |
| echo "1. Download \`xenos-dev-build.zip\`" >> dev-release-notes.md | |
| echo "2. Extract the archive" >> dev-release-notes.md | |
| echo "3. Serve the contents using a web server (e.g., \`npx serve\` or \`python -m http.server\`)" >> dev-release-notes.md | |
| echo "4. Open the served URL in your browser" >> dev-release-notes.md | |
| - name: Delete previous dev release | |
| run: | | |
| gh release delete dev-build --yes || true | |
| git push --delete origin dev-build || true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Dev Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: dev-build | |
| name: XenOS Development Build | |
| body_path: dev-release-notes.md | |
| files: | | |
| xenos-dev-build.zip | |
| draft: false | |
| prerelease: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |