Release #7
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: | |
| jobs: | |
| Release: | |
| runs-on: ubuntu-latest | |
| env: | |
| CI: true | |
| steps: | |
| - name: Check out | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GH_TOKEN }} | |
| - name: Check if branch is main | |
| run: | | |
| if [[ "${GITHUB_REF##*/}" != "main" ]]; then | |
| echo "This workflow can only be triggered for the main branch." | |
| exit 1 | |
| fi | |
| - name: Check out blue-quickjs | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: bluecontract/blue-quickjs | |
| path: blue-quickjs | |
| submodules: recursive | |
| - name: Set up JDK | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'corretto' | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 9.8.0 | |
| run_install: false | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: 'blue-quickjs/.nvmrc' | |
| cache: 'pnpm' | |
| cache-dependency-path: 'blue-quickjs/pnpm-lock.yaml' | |
| - name: Cache emsdk | |
| uses: actions/cache@v4 | |
| with: | |
| path: blue-quickjs/tools/emsdk | |
| key: emsdk-${{ runner.os }}-${{ hashFiles('blue-quickjs/tools/scripts/emsdk-version.txt') }} | |
| - name: Install blue-quickjs dependencies | |
| run: pnpm install --frozen-lockfile | |
| working-directory: blue-quickjs | |
| - name: Install emsdk | |
| run: bash tools/scripts/setup-emsdk.sh | |
| working-directory: blue-quickjs | |
| - name: Build blue-quickjs runtime | |
| run: pnpm exec nx build quickjs-runtime | |
| working-directory: blue-quickjs | |
| - name: Setup Gradle | |
| uses: gradle/gradle-build-action@v2 | |
| - name: Execute Gradle build | |
| run: ./gradlew clean build -Dblue.quickjs.root="$GITHUB_WORKSPACE/blue-quickjs" | |
| - name: Execute Gradle publish | |
| run: ./gradlew publish -Dblue.quickjs.root="$GITHUB_WORKSPACE/blue-quickjs" | |
| - name: Execute Gradle release | |
| env: | |
| JRELEASER_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
| JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.MAVENCENTRAL_USERNAME }} | |
| JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.MAVENCENTRAL_PASSWORD }} | |
| JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
| JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} | |
| JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | |
| run: ./gradlew jreleaserFullRelease | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: artifacts | |
| path: | | |
| build/libs | |
| build/publications | |
| build/jreleaser |