Release #5
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: | |
| inputs: | |
| tag_name: | |
| description: Tag to release (for example v1.0.0) | |
| required: true | |
| type: string | |
| release_name: | |
| description: Optional release title override | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| publish-npm: | |
| name: Publish ${{ matrix.package.name }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| package: | |
| - name: ecmacraft | |
| path: packages/ecmacraft | |
| - name: create-ecmacraft | |
| path: packages/create-ecmacraft | |
| - name: '@ecmacraft/types' | |
| path: packages/types | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.0.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: https://registry.npmjs.org | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build shared types package | |
| run: pnpm --filter @ecmacraft/types build | |
| - name: Publish package | |
| working-directory: ${{ matrix.package.path }} | |
| run: pnpm publish --no-git-checks --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| draft-release: | |
| name: Draft GitHub release | |
| runs-on: ubuntu-latest | |
| needs: publish-npm | |
| env: | |
| RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag_name || github.ref_name }} | |
| RELEASE_NAME: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.release_name || '' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '21' | |
| - name: Build ecmacraft JAR | |
| working-directory: ecmacraft | |
| run: mvn -B clean package -DskipTests | |
| - name: Prepare release asset | |
| run: cp ecmacraft/target/ecmacraft-1.0-SNAPSHOT.jar ecmacraft/target/ecmacraft.jar | |
| - name: Create draft release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.RELEASE_TAG }} | |
| name: ${{ env.RELEASE_NAME != '' && env.RELEASE_NAME || env.RELEASE_TAG }} | |
| draft: true | |
| generate_release_notes: true | |
| files: ecmacraft/target/ecmacraft.jar |