chore: bump version to 0.7.0 #53
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: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| permissions: | |
| contents: write | |
| id-token: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| cargo_flags: "--no-default-features" | |
| cross: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.target }} | |
| - name: Install cross-compilation tools | |
| if: matrix.cross | |
| run: | | |
| sudo dpkg --add-architecture arm64 | |
| # Restrict existing sources to amd64 (DEB822 .sources format on Ubuntu 24.04+) | |
| if [ -f /etc/apt/sources.list.d/ubuntu.sources ]; then | |
| sudo sed -i '/^Types: deb/i Architectures: amd64' /etc/apt/sources.list.d/ubuntu.sources | |
| fi | |
| # Also handle classic .list format for third-party repos | |
| sudo sed -i '/\[arch=/!s/^deb /deb [arch=amd64] /' /etc/apt/sources.list.d/*.list 2>/dev/null || true | |
| # Add arm64 packages from ports.ubuntu.com | |
| CODENAME=$(lsb_release -cs) | |
| cat <<SOURCES | sudo tee /etc/apt/sources.list.d/arm64-cross.list | |
| deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME} main restricted universe | |
| deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-updates main restricted universe | |
| deb [arch=arm64] http://ports.ubuntu.com/ ${CODENAME}-security main restricted universe | |
| SOURCES | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev:arm64 | |
| echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
| echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV | |
| echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV | |
| - name: Build | |
| run: cargo build --release --target ${{ matrix.target }} ${{ matrix.cargo_flags }} | |
| - name: Package (unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| tar czf ../../../rpg-encoder-${{ matrix.target }}.tar.gz rpg-encoder rpg-mcp-server | |
| cd ../../.. | |
| - name: Package (windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| 7z a ../../../rpg-encoder-${{ matrix.target }}.zip rpg-encoder.exe rpg-mcp-server.exe | |
| cd ../../.. | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rpg-encoder-${{ matrix.target }} | |
| path: rpg-encoder-${{ matrix.target }}.* | |
| release: | |
| name: Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: artifacts/* | |
| npm-publish: | |
| name: Publish to npm | |
| needs: release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| - name: Configure npm registry for OIDC trusted publishing | |
| run: | | |
| echo "registry=https://registry.npmjs.org/" > "$HOME/.npmrc" | |
| echo "node $(node --version), npm $(npm --version)" | |
| cat "$HOME/.npmrc" | |
| - name: Sync version from git tag | |
| working-directory: npm | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| npm version "$VERSION" --no-git-tag-version --allow-same-version | |
| - name: Publish to npm | |
| working-directory: npm | |
| run: npm publish --access public --provenance || echo "Version already published, skipping" |