From f07756650b5fcd88a22d23b915a915ecee623829 Mon Sep 17 00:00:00 2001 From: grandwizard28 Date: Wed, 25 Sep 2024 13:28:20 +0530 Subject: [PATCH 1/4] feat(js-release): add js-release pipeline --- .github/workflows/js-release.yaml | 45 +++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/js-release.yaml diff --git a/.github/workflows/js-release.yaml b/.github/workflows/js-release.yaml new file mode 100644 index 0000000..1a1446e --- /dev/null +++ b/.github/workflows/js-release.yaml @@ -0,0 +1,45 @@ +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 From ba440ecd12ff867b129a72a031f380873c6b8d82 Mon Sep 17 00:00:00 2001 From: grandwizard28 Date: Wed, 25 Sep 2024 13:43:45 +0530 Subject: [PATCH 2/4] feat(js-release): complete the pipeline --- .github/workflows/js-release.yaml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/js-release.yaml b/.github/workflows/js-release.yaml index 1a1446e..73b7362 100644 --- a/.github/workflows/js-release.yaml +++ b/.github/workflows/js-release.yaml @@ -43,3 +43,21 @@ jobs: - 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: create-release + uses: changesets/action@v1 + with: + publish: pnpm release + env: + GITHUB_TOKEN: ${{ steps.token.outputs.token }} + NPM_TOKEN: ${{ secrets.PRIMUS_NPM_TOKEN }} From 6a2447fb796d9f3500d74c88fd98107c3b7dac9a Mon Sep 17 00:00:00 2001 From: grandwizard28 Date: Wed, 25 Sep 2024 14:02:18 +0530 Subject: [PATCH 3/4] feat(git): create a git-user command --- .github/workflows/js-release.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/js-release.yaml b/.github/workflows/js-release.yaml index 73b7362..0e244d1 100644 --- a/.github/workflows/js-release.yaml +++ b/.github/workflows/js-release.yaml @@ -54,10 +54,14 @@ jobs: 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 env: GITHUB_TOKEN: ${{ steps.token.outputs.token }} NPM_TOKEN: ${{ secrets.PRIMUS_NPM_TOKEN }} From 754392b224af0a29fb2e3a86c171c55e14b3eada Mon Sep 17 00:00:00 2001 From: grandwizard28 Date: Wed, 25 Sep 2024 14:47:57 +0530 Subject: [PATCH 4/4] feat(js-release): make git-user --- .github/workflows/js-release.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/js-release.yaml b/.github/workflows/js-release.yaml index 0e244d1..8c00a7d 100644 --- a/.github/workflows/js-release.yaml +++ b/.github/workflows/js-release.yaml @@ -62,6 +62,7 @@ jobs: with: publish: pnpm release setupGitUser: false + createGithubReleases: false env: GITHUB_TOKEN: ${{ steps.token.outputs.token }} NPM_TOKEN: ${{ secrets.PRIMUS_NPM_TOKEN }}