From 73beaa766ae37f2f8c61fabdb1626fd0eebcc9e7 Mon Sep 17 00:00:00 2001 From: "EP\\qang2" Date: Mon, 26 Aug 2024 15:34:48 +0700 Subject: [PATCH 1/4] Update github build for jira versioning --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f0aef80..5bed232 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,9 +6,12 @@ on: - master - develop - feature/* - - bugfix/* pull_request: - branches: [ "develop" ] + branches: + - "*" + - master + - feature/** + - release/** permissions: contents: write @@ -18,6 +21,8 @@ permissions: env: NPM_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} AZURE_TOKEN: ${{ secrets.AZURE_TOKEN }} + JIRA_USERNAME: ${{ secrets.JIRA_BOT_USERNAME }} + JIRA_PASSWORD: ${{ secrets.JIRA_BOT_PASSWORD }} jobs: build: @@ -33,13 +38,13 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - + - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: 'npm' - + cache: "npm" + - name: Setup dependencies run: npm ci @@ -56,4 +61,26 @@ jobs: - name: Publish if: ${{ github.ref == 'refs/heads/master' }} - run: npm run publish \ No newline at end of file + run: npm run publish + + jira-release: + if: ${{ contains(github.ref,'release/') }} + runs-on: windows-latest + name: Get release version & create JIRA release + needs: build_test_pack + steps: + - name: Checkout repository + uses: actions/checkout@v1 + + - name: Get release version + uses: episerver/addons-jira-automation/releaseversion@v1 + id: branchVersion + + - name: Create JIRA release + uses: episerver/addons-jira-automation/release@v1 + with: + jira-project: AFORM + jira-package: OPTIMIZELY.FORMS.HEADLESS.JS.SDK + jira-host: jira.sso.episerver.net + version: ${{ steps.branchVersion.outputs.manifestSafeVersionString }} + versionSuffix: ${{needs.build_test_pack.outputs.versionSuffix}} From 2689d670cf36b624b17bcbc22d55736d3910e5b1 Mon Sep 17 00:00:00 2001 From: "EP\\qang2" Date: Mon, 26 Aug 2024 15:55:15 +0700 Subject: [PATCH 2/4] Update build name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5bed232..cb6c321 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ env: JIRA_PASSWORD: ${{ secrets.JIRA_BOT_PASSWORD }} jobs: - build: + build_test_pack: name: Build, test, and publish runs-on: windows-latest env: From 21eacae636f14b5c7d60d701d936b1c64362ac17 Mon Sep 17 00:00:00 2001 From: "EP\\qang2" Date: Mon, 26 Aug 2024 17:13:59 +0700 Subject: [PATCH 3/4] Add pull request to github ci --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb6c321..a35124a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: run: npm run publish jira-release: - if: ${{ contains(github.ref,'release/') }} + if: ${{ contains(github.ref,'release/') }} || contains(github.head_ref, 'release/') }} runs-on: windows-latest name: Get release version & create JIRA release needs: build_test_pack From dd902a1606f7c35304ac0d2f7f061f68458013ba Mon Sep 17 00:00:00 2001 From: "EP\\qang2" Date: Mon, 26 Aug 2024 17:19:46 +0700 Subject: [PATCH 4/4] Fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a35124a..47bcdb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: run: npm run publish jira-release: - if: ${{ contains(github.ref,'release/') }} || contains(github.head_ref, 'release/') }} + if: ${{ contains(github.ref,'release/') }} runs-on: windows-latest name: Get release version & create JIRA release needs: build_test_pack