diff --git a/.github/workflows/js-release.yaml b/.github/workflows/js-release.yaml new file mode 100644 index 0000000..8c00a7d --- /dev/null +++ b/.github/workflows/js-release.yaml @@ -0,0 +1,68 @@ +name: js-release +on: + workflow_call: + inputs: + PRIMUS_REF: + description: 'The primus ref to checkout.' + required: true + default: 'main' + type: string + +defaults: + run: + shell: bash + +env: + PRIMUS_HOME: .primus + MAKE: make --no-print-directory --makefile=.primus/src/make/main.mk + +jobs: + release: + runs-on: ubuntu-latest + environment: ${{ github.ref_type == 'tag' && 'production' || github.ref_name == 'main' && 'staging' || 'review' }} + permissions: + contents: 'read' + id-token: 'write' + steps: + - name: self-checkout + uses: actions/checkout@v4 + - id: token + name: github-token-gen + uses: actions/create-github-app-token@v1 + with: + app-id: ${{ secrets.PRIMUS_APP_ID }} + private-key: ${{ secrets.PRIMUS_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + - name: primus-checkout + uses: actions/checkout@v4 + with: + repository: signoz/primus + ref: ${{ inputs.PRIMUS_REF }} + path: .primus + token: ${{ steps.token.outputs.token }} + - name: info + run: | + $MAKE info + - name: pnpm-install + uses: pnpm/action-setup@v3 + with: + version: 8 + - name: node-install + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "pnpm" + - name: deps-install + run: pnpm install + - name: setup-git + run: | + $MAKE git-user + - name: create-release + uses: changesets/action@v1 + with: + publish: pnpm release + setupGitUser: false + createGithubReleases: false + env: + GITHUB_TOKEN: ${{ steps.token.outputs.token }} + NPM_TOKEN: ${{ secrets.PRIMUS_NPM_TOKEN }}