Release #199
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: | |
| workflow_dispatch: | |
| permissions: {} | |
| env: | |
| RELEASE_BUILD: 'true' | |
| jobs: | |
| build-rust: | |
| runs-on: ${{ matrix.settings.os }} | |
| permissions: | |
| contents: read | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| settings: | |
| - target: aarch64-apple-darwin | |
| os: namespace-profile-mac-default | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| # - aarch64-pc-windows-msvc | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: ./.github/actions/clone | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| - uses: oxc-project/setup-rust@d286d43bc1f606abbd98096666ff8be68c8d5f57 # v1.0.2 | |
| with: | |
| save-cache: ${{ github.ref_name == 'main' }} | |
| cache-key: release | |
| - name: Rustup Adds Target | |
| run: rustup target add ${{ matrix.settings.target }} | |
| - name: Rustup Adds Target for rolldown | |
| working-directory: rolldown | |
| run: rustup target add ${{ matrix.settings.target }} | |
| - name: Add musl target (x86_64) | |
| if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} | |
| run: rustup target add x86_64-unknown-linux-musl | |
| - name: Add musl target (aarch64) | |
| if: ${{ matrix.settings.target == 'aarch64-unknown-linux-gnu' }} | |
| run: rustup target add aarch64-unknown-linux-musl | |
| - name: Add rolldown host target | |
| if: ${{ matrix.settings.target == 'aarch64-unknown-linux-gnu' }} | |
| working-directory: rolldown | |
| run: rustup target add x86_64-unknown-linux-gnu | |
| - uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4 | |
| - name: Build host rolldown | |
| if: ${{ matrix.settings.target == 'aarch64-unknown-linux-gnu' }} | |
| run: pnpm --filter rolldown build-binding:release --target x86_64-unknown-linux-gnu | |
| - name: Set binding version | |
| run: pnpm exec tool replace-file-content packages/cli/binding/Cargo.toml 'version = "0.0.0"' 'version = "0.0.0-${{ github.sha }}"' | |
| - name: Configure Git for access to vite-task | |
| run: git config --global url."https://x-access-token:${{ secrets.VITE_TASK_TOKEN }}@github.com/".insteadOf "https://github.com/" | |
| - name: Build | |
| uses: ./.github/actions/build-upstream | |
| with: | |
| target: ${{ matrix.settings.target }} | |
| build-rolldown-native: 'true' | |
| - name: Build global cli | |
| if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} | |
| run: pnpm --filter @voidzero-dev/global build | |
| - name: Upload Vite+ artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: vite-plus-native-${{ matrix.settings.target }} | |
| path: ./packages/cli/binding/*.node | |
| if-no-files-found: error | |
| - name: Upload rolldown artifact | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| with: | |
| name: rolldown-native-${{ matrix.settings.target }} | |
| path: ./rolldown/packages/rolldown/src/*.node | |
| if-no-files-found: error | |
| - name: Remove .node files before upload dist | |
| if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} | |
| run: | | |
| rm ./packages/core/dist/**/*.node | |
| - name: Upload core dist | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} | |
| with: | |
| name: core | |
| path: ./packages/core/dist | |
| if-no-files-found: error | |
| - name: Upload cli dist | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} | |
| with: | |
| name: cli | |
| path: ./packages/cli/dist | |
| if-no-files-found: error | |
| - name: Upload global dist | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | |
| if: ${{ matrix.settings.target == 'x86_64-unknown-linux-gnu' }} | |
| with: | |
| name: global | |
| path: ./packages/global/dist | |
| if-no-files-found: error | |
| Release: | |
| runs-on: ubuntu-latest | |
| needs: build-rust | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - uses: ./.github/actions/clone | |
| - uses: oxc-project/setup-node@fdbf0dfd334c4e6d56ceeb77d91c76339c2a0885 # v1.0.4 | |
| - name: Configure Git for access to vite-task | |
| run: git config --global url."https://x-access-token:${{ secrets.VITE_TASK_TOKEN }}@github.com/".insteadOf "https://github.com/" | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| path: packages/cli/dist | |
| pattern: cli | |
| merge-multiple: true | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| path: packages/cli/binding | |
| pattern: vite-plus-native-* | |
| merge-multiple: true | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| path: packages/core/dist | |
| pattern: core | |
| merge-multiple: true | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| path: packages/core/dist/rolldown/shared | |
| pattern: rolldown-native-* | |
| merge-multiple: true | |
| - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 | |
| with: | |
| path: packages/global/dist | |
| pattern: global | |
| merge-multiple: true | |
| - name: Set npm packages version | |
| run: | | |
| sed -i 's/"version": "0.0.0"/"version": "0.0.0-${{ github.sha }}"/' packages/core/package.json | |
| sed -i 's/"version": "0.0.0"/"version": "0.0.0-${{ github.sha }}"/' packages/test/package.json | |
| sed -i 's/"version": "0.0.0"/"version": "0.0.0-${{ github.sha }}"/' packages/cli/package.json | |
| sed -i 's/"version": "0.0.0"/"version": "0.0.0-${{ github.sha }}"/' packages/global/package.json | |
| # Setup node correctly for publishing to github registry | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 | |
| with: | |
| node-version-file: .node-version | |
| registry-url: 'https://npm.pkg.github.com' | |
| scope: '@voidzero-dev' | |
| package-manager-cache: false | |
| - name: Build test | |
| run: pnpm --filter=@voidzero-dev/vite-plus-test build | |
| - run: npm install -g npm@latest # For trusted publishing support | |
| - name: Publish | |
| run: | | |
| pnpm publish --filter=./packages/core --registry https://npm.pkg.github.com --no-git-checks | |
| pnpm publish --filter=./packages/test --registry https://npm.pkg.github.com --no-git-checks | |
| pnpm publish --filter=./packages/cli --registry https://npm.pkg.github.com --no-git-checks | |
| pnpm publish --filter=./packages/global --registry https://npm.pkg.github.com --no-git-checks | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |