From 4b1d6c5e63c606ff3dec3bb02f1222ac701a135a Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 09:25:03 +0930 Subject: [PATCH 01/13] DO-1285: Release process --- .github/workflows/release-basic-auth.yml | 36 ------------- .../release-cloudfront-security-headers.yml | 36 ------------- .github/workflows/release-geoip-redirect.yml | 36 ------------- .github/workflows/release-prerender-proxy.yml | 36 ------------- .github/workflows/release-rabbitmq.yml | 36 ------------- .../release-serverless-deploy-iam.yml | 36 ------------- .github/workflows/release-static-hosting.yml | 36 ------------- .github/workflows/release-waf.yml | 36 ------------- .github/workflows/release.yml | 51 +++++++++++++++++++ 9 files changed, 51 insertions(+), 288 deletions(-) delete mode 100644 .github/workflows/release-basic-auth.yml delete mode 100644 .github/workflows/release-cloudfront-security-headers.yml delete mode 100644 .github/workflows/release-geoip-redirect.yml delete mode 100644 .github/workflows/release-prerender-proxy.yml delete mode 100644 .github/workflows/release-rabbitmq.yml delete mode 100644 .github/workflows/release-serverless-deploy-iam.yml delete mode 100644 .github/workflows/release-static-hosting.yml delete mode 100644 .github/workflows/release-waf.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release-basic-auth.yml b/.github/workflows/release-basic-auth.yml deleted file mode 100644 index 7ee87be3..00000000 --- a/.github/workflows/release-basic-auth.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Publish to NPM - -env: - package: basic-auth - -on: - release: - tags: - - '$package-*' # Push events matching the package name, i.e. basic-auth-1.12.6 - types: [published] - -jobs: - build-and-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.release.target_commitish }} - - name: Use Node.js 16 - uses: actions/setup-node@v1 - with: - node-version: 16 - registry-url: https://registry.npmjs.org/ - - run: echo "VERSION=${{ github.event.release.tag_name }}#"$package-"" # strip the package out of the release name - - run: npm ci - - run: git config --global user.name "Automated NPM Release" - - run: git config --global user.email "sysadmin+npm-deploy@aligent.com.au" - - run: npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${package}" - - run: npm run build --workspace "@aligent/cdk-${package}" - - run: npm test --workspace "@aligent/cdk-${package}" --if-present - - run: npm publish --access public --workspace "@aligent/cdk-${package}" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: git push - env: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-cloudfront-security-headers.yml b/.github/workflows/release-cloudfront-security-headers.yml deleted file mode 100644 index 3629aff3..00000000 --- a/.github/workflows/release-cloudfront-security-headers.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Publish to NPM - -env: - package: cloudfront-security-headers - -on: - release: - tags: - - '$package-*' # Push events matching the package name, i.e. basic-auth-1.12.6 - types: [published] - -jobs: - build-and-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.release.target_commitish }} - - name: Use Node.js 16 - uses: actions/setup-node@v1 - with: - node-version: 16 - registry-url: https://registry.npmjs.org/ - - run: echo "VERSION=${{ github.event.release.tag_name }}#"$package-"" # strip the package out of the release name - - run: npm ci - - run: git config --global user.name "Automated NPM Release" - - run: git config --global user.email "sysadmin+npm-deploy@aligent.com.au" - - run: npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${package}" - - run: npm run build --workspace "@aligent/cdk-${package}" - - run: npm test --workspace "@aligent/cdk-${package}" --if-present - - run: npm publish --access public --workspace "@aligent/cdk-${package}" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: git push - env: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-geoip-redirect.yml b/.github/workflows/release-geoip-redirect.yml deleted file mode 100644 index ff0aa903..00000000 --- a/.github/workflows/release-geoip-redirect.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Publish to NPM - -env: - package: geoip-redirect - -on: - release: - tags: - - '$package-*' # Push events matching the package name, i.e. basic-auth-1.12.6 - types: [published] - -jobs: - build-and-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.release.target_commitish }} - - name: Use Node.js 16 - uses: actions/setup-node@v1 - with: - node-version: 16 - registry-url: https://registry.npmjs.org/ - - run: echo "VERSION=${{ github.event.release.tag_name }}#"$package-"" # strip the package out of the release name - - run: npm ci - - run: git config --global user.name "Automated NPM Release" - - run: git config --global user.email "sysadmin+npm-deploy@aligent.com.au" - - run: npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${package}" - - run: npm run build --workspace "@aligent/cdk-${package}" - - run: npm test --workspace "@aligent/cdk-${package}" --if-present - - run: npm publish --access public --workspace "@aligent/cdk-${package}" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: git push - env: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-prerender-proxy.yml b/.github/workflows/release-prerender-proxy.yml deleted file mode 100644 index f57e076c..00000000 --- a/.github/workflows/release-prerender-proxy.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Publish to NPM - -env: - package: prerender-proxy - -on: - release: - tags: - - '$package-*' # Push events matching the package name, i.e. basic-auth-1.12.6 - types: [published] - -jobs: - build-and-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.release.target_commitish }} - - name: Use Node.js 16 - uses: actions/setup-node@v1 - with: - node-version: 16 - registry-url: https://registry.npmjs.org/ - - run: echo "VERSION=${{ github.event.release.tag_name }}#"$package-"" # strip the package out of the release name - - run: npm ci - - run: git config --global user.name "Automated NPM Release" - - run: git config --global user.email "sysadmin+npm-deploy@aligent.com.au" - - run: npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${package}" - - run: npm run build --workspace "@aligent/cdk-${package}" - - run: npm test --workspace "@aligent/cdk-${package}" --if-present - - run: npm publish --access public --workspace "@aligent/cdk-${package}" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: git push - env: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-rabbitmq.yml b/.github/workflows/release-rabbitmq.yml deleted file mode 100644 index 5a5d86a9..00000000 --- a/.github/workflows/release-rabbitmq.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Publish to NPM - -env: - package: rabbitmq - -on: - release: - tags: - - '$package-*' # Push events matching the package name, i.e. basic-auth-1.12.6 - types: [published] - -jobs: - build-and-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.release.target_commitish }} - - name: Use Node.js 16 - uses: actions/setup-node@v1 - with: - node-version: 16 - registry-url: https://registry.npmjs.org/ - - run: echo "VERSION=${{ github.event.release.tag_name }}#"$package-"" # strip the package out of the release name - - run: npm ci - - run: git config --global user.name "Automated NPM Release" - - run: git config --global user.email "sysadmin+npm-deploy@aligent.com.au" - - run: npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${package}" - - run: npm run build --workspace "@aligent/cdk-${package}" - - run: npm test --workspace "@aligent/cdk-${package}" --if-present - - run: npm publish --access public --workspace "@aligent/cdk-${package}" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: git push - env: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-serverless-deploy-iam.yml b/.github/workflows/release-serverless-deploy-iam.yml deleted file mode 100644 index e0ea23d4..00000000 --- a/.github/workflows/release-serverless-deploy-iam.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Publish to NPM - -env: - package: serverless-deploy-iam - -on: - release: - tags: - - '$package-*' # Push events matching the package name, i.e. basic-auth-1.12.6 - types: [published] - -jobs: - build-and-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.release.target_commitish }} - - name: Use Node.js 16 - uses: actions/setup-node@v1 - with: - node-version: 16 - registry-url: https://registry.npmjs.org/ - - run: echo "VERSION=${{ github.event.release.tag_name }}#"$package-"" # strip the package out of the release name - - run: npm ci - - run: git config --global user.name "Automated NPM Release" - - run: git config --global user.email "sysadmin+npm-deploy@aligent.com.au" - - run: npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${package}" - - run: npm run build --workspace "@aligent/cdk-${package}" - - run: npm test --workspace "@aligent/cdk-${package}" --if-present - - run: npm publish --access public --workspace "@aligent/cdk-${package}" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: git push - env: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-static-hosting.yml b/.github/workflows/release-static-hosting.yml deleted file mode 100644 index 8fed196a..00000000 --- a/.github/workflows/release-static-hosting.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Publish to NPM - -env: - package: static-hosting - -on: - release: - tags: - - '$package-*' # Push events matching the package name, i.e. basic-auth-1.12.6 - types: [published] - -jobs: - build-and-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.release.target_commitish }} - - name: Use Node.js 16 - uses: actions/setup-node@v1 - with: - node-version: 16 - registry-url: https://registry.npmjs.org/ - - run: echo "VERSION=${{ github.event.release.tag_name }}#"$package-"" # strip the package out of the release name - - run: npm ci - - run: git config --global user.name "Automated NPM Release" - - run: git config --global user.email "sysadmin+npm-deploy@aligent.com.au" - - run: npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${package}" - - run: npm run build --workspace "@aligent/cdk-${package}" - - run: npm test --workspace "@aligent/cdk-${package}" --if-present - - run: npm publish --access public --workspace "@aligent/cdk-${package}" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: git push - env: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-waf.yml b/.github/workflows/release-waf.yml deleted file mode 100644 index a0a95091..00000000 --- a/.github/workflows/release-waf.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Publish to NPM - -env: - package: waf - -on: - release: - tags: - - '$package-*' # Push events matching the package name, i.e. basic-auth-1.12.6 - types: [published] - -jobs: - build-and-publish: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - with: - ref: ${{ github.event.release.target_commitish }} - - name: Use Node.js 16 - uses: actions/setup-node@v1 - with: - node-version: 16 - registry-url: https://registry.npmjs.org/ - - run: echo "VERSION=${{ github.event.release.tag_name }}#"$package-"" # strip the package out of the release name - - run: npm ci - - run: git config --global user.name "Automated NPM Release" - - run: git config --global user.email "sysadmin+npm-deploy@aligent.com.au" - - run: npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${package}" - - run: npm run build --workspace "@aligent/cdk-${package}" - - run: npm test --workspace "@aligent/cdk-${package}" --if-present - - run: npm publish --access public --workspace "@aligent/cdk-${package}" - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - run: git push - env: - github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..781fbe31 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,51 @@ +name: Publish to NPM + +env: + RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} + +on: + push: + tags: + - '**-[0-9].[0-9].[0-9]' + - '**-[0-9].[0-9].[0-9]-*' + release: + tags: + - '**-[0-9].[0-9].[0-9]' + - '**-[0-9].[0-9].[0-9]-*' + types: [published] + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + # Source checkout + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.release.target_commitish }} + # Setting Node environment + - name: Setting up Node environment + uses: actions/setup-node@v1 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + # Environment configuration + - name: Preparing environment for release + run: | + CONSTRUCT=$(echo $RELEASE_TAG_NAME | sed 's/^.*[A-Za-z]-//g) + VERSION=$(echo $RELEASE_TAG_NAME | sed "s/${CONSTRUCT}-//g"); + # Release process + - name: Release + working-directory: $CONSTRUCT + run: | + npm ci + git config --global user.name "Automated NPM Release" + git config --global user.email "sysadmin+npm-deploy@aligent.com.au" + npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${package}" + npm run build --workspace "@aligent/cdk-${package}" + npm test --workspace "@aligent/cdk-${package}" --if-present + # npm publish --access public --workspace "@aligent/cdk-${package}" + # env: + # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + # - run: git push + # env: + # github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 80e0f2f9df603a571b7c2d1bddc74c19c3ed58e6 Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 09:49:49 +0930 Subject: [PATCH 02/13] DO-1285: Use GITHUB_REF_NAME --- .github/workflows/release.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 781fbe31..eae85c2d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,8 +1,5 @@ name: Publish to NPM -env: - RELEASE_TAG_NAME: ${{ github.event.release.tag_name }} - on: push: tags: @@ -31,8 +28,8 @@ jobs: # Environment configuration - name: Preparing environment for release run: | - CONSTRUCT=$(echo $RELEASE_TAG_NAME | sed 's/^.*[A-Za-z]-//g) - VERSION=$(echo $RELEASE_TAG_NAME | sed "s/${CONSTRUCT}-//g"); + CONSTRUCT=$(echo $GITHUB_REF_NAME | sed 's/^.*[A-Za-z]-//g) + VERSION=$(echo $GITHUB_REF_NAME | sed "s/${CONSTRUCT}-//g"); # Release process - name: Release working-directory: $CONSTRUCT From e89e2755b7c643a6b3b4aea6954e8f02eb6b7bc4 Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 09:52:06 +0930 Subject: [PATCH 03/13] DO-1285: Fixed typo --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index eae85c2d..6f161f36 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: # Environment configuration - name: Preparing environment for release run: | - CONSTRUCT=$(echo $GITHUB_REF_NAME | sed 's/^.*[A-Za-z]-//g) + CONSTRUCT=$(echo $GITHUB_REF_NAME | sed 's/^.*[A-Za-z]-//g') VERSION=$(echo $GITHUB_REF_NAME | sed "s/${CONSTRUCT}-//g"); # Release process - name: Release From b8b508ec8fad80bc802c3a483a148f0f199875e9 Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 10:02:12 +0930 Subject: [PATCH 04/13] DO-1285: set working directory --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f161f36..bdf11e20 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: VERSION=$(echo $GITHUB_REF_NAME | sed "s/${CONSTRUCT}-//g"); # Release process - name: Release - working-directory: $CONSTRUCT + working-directory: ./packages/$CONSTRUCT run: | npm ci git config --global user.name "Automated NPM Release" From 577167791a2dac0ad3904a14303037adfb4c04bc Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 10:04:04 +0930 Subject: [PATCH 05/13] DO-1285: fixed working directory path --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bdf11e20..a7492272 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: VERSION=$(echo $GITHUB_REF_NAME | sed "s/${CONSTRUCT}-//g"); # Release process - name: Release - working-directory: ./packages/$CONSTRUCT + working-directory: packages/$CONSTRUCT run: | npm ci git config --global user.name "Automated NPM Release" From 06c8a8ffb5f8235c81992b646132674bf8f47118 Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 10:16:50 +0930 Subject: [PATCH 06/13] DO-1285: Fix construct and version string manipulation --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a7492272..e38e4a0e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,8 +28,8 @@ jobs: # Environment configuration - name: Preparing environment for release run: | - CONSTRUCT=$(echo $GITHUB_REF_NAME | sed 's/^.*[A-Za-z]-//g') - VERSION=$(echo $GITHUB_REF_NAME | sed "s/${CONSTRUCT}-//g"); + VERSION=$(echo $GITHUB_REF_NAME | sed 's/^.*[A-Za-z]-//g') + CONSTRUCT=$(echo $GITHUB_REF_NAME | sed "s/-${VERSION}//g") # Release process - name: Release working-directory: packages/$CONSTRUCT From e3ee1242726cd3313e44951721381a3a48516a8b Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 10:31:03 +0930 Subject: [PATCH 07/13] DO-1285: Debug working directory --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e38e4a0e..0e19e506 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,6 +30,9 @@ jobs: run: | VERSION=$(echo $GITHUB_REF_NAME | sed 's/^.*[A-Za-z]-//g') CONSTRUCT=$(echo $GITHUB_REF_NAME | sed "s/-${VERSION}//g") + env + pwd + ls # Release process - name: Release working-directory: packages/$CONSTRUCT From e0510a9e503133ea6b2ee8761c6aba627ba509c3 Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 10:33:37 +0930 Subject: [PATCH 08/13] DO-1285: Debug working directory --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e19e506..94ee6cac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,6 +33,7 @@ jobs: env pwd ls + echo $CONSTRUCT # Release process - name: Release working-directory: packages/$CONSTRUCT From c95e3c2c69a515aed9ce1ae24c43d9ce0c62b365 Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 10:59:05 +0930 Subject: [PATCH 09/13] DO-1285: Use GITHUB_ENV --- .github/workflows/release.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 94ee6cac..b14ff41d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,14 +29,13 @@ jobs: - name: Preparing environment for release run: | VERSION=$(echo $GITHUB_REF_NAME | sed 's/^.*[A-Za-z]-//g') - CONSTRUCT=$(echo $GITHUB_REF_NAME | sed "s/-${VERSION}//g") + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "CONSTRUCT=$(echo $GITHUB_REF_NAME | sed "s/-${VERSION}//g")" >> $GITHUB_ENV env - pwd - ls - echo $CONSTRUCT + echo ${{env.CONSTRUCT}} # Release process - name: Release - working-directory: packages/$CONSTRUCT + working-directory: packages/${{env.CONSTRUCT}} run: | npm ci git config --global user.name "Automated NPM Release" From d90cd9a90b8bb179e23cab393f2808c4948f3c66 Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 11:07:58 +0930 Subject: [PATCH 10/13] DO-1285: Fix package naming --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b14ff41d..d58654fd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,12 +31,11 @@ jobs: VERSION=$(echo $GITHUB_REF_NAME | sed 's/^.*[A-Za-z]-//g') echo "VERSION=$VERSION" >> $GITHUB_ENV echo "CONSTRUCT=$(echo $GITHUB_REF_NAME | sed "s/-${VERSION}//g")" >> $GITHUB_ENV - env - echo ${{env.CONSTRUCT}} # Release process - name: Release working-directory: packages/${{env.CONSTRUCT}} run: | + echo ${{env.CONSTRUCT}} npm ci git config --global user.name "Automated NPM Release" git config --global user.email "sysadmin+npm-deploy@aligent.com.au" From 255f7ab693a9df1696aeab8c4b1e6c976730c482 Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 11:17:07 +0930 Subject: [PATCH 11/13] DO-1285: Fix package naming --- .github/workflows/release.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d58654fd..80726e98 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,19 +30,18 @@ jobs: run: | VERSION=$(echo $GITHUB_REF_NAME | sed 's/^.*[A-Za-z]-//g') echo "VERSION=$VERSION" >> $GITHUB_ENV - echo "CONSTRUCT=$(echo $GITHUB_REF_NAME | sed "s/-${VERSION}//g")" >> $GITHUB_ENV + echo "PACKAGE=$(echo $GITHUB_REF_NAME | sed "s/-${VERSION}//g")" >> $GITHUB_ENV # Release process - name: Release - working-directory: packages/${{env.CONSTRUCT}} run: | - echo ${{env.CONSTRUCT}} + echo ${{env.PACKAGE}} npm ci git config --global user.name "Automated NPM Release" git config --global user.email "sysadmin+npm-deploy@aligent.com.au" - npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${package}" - npm run build --workspace "@aligent/cdk-${package}" - npm test --workspace "@aligent/cdk-${package}" --if-present - # npm publish --access public --workspace "@aligent/cdk-${package}" + npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${{env.PACKAGE}}" + npm run build --workspace "@aligent/cdk-${{env.PACKAGE}}" + npm test --workspace "@aligent/cdk-${{env.PACKAGE}}" --if-present + # npm publish --access public --workspace "@aligent/cdk-${{env.PACKAGE}}" # env: # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # - run: git push From 41eccec6192805d289f8ab4dd3a5336ce59e381b Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 13:56:43 +0930 Subject: [PATCH 12/13] DO-1285: include npm publish command --- .github/workflows/release.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 80726e98..fdef66d5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,6 @@ name: Publish to NPM on: - push: - tags: - - '**-[0-9].[0-9].[0-9]' - - '**-[0-9].[0-9].[0-9]-*' release: tags: - '**-[0-9].[0-9].[0-9]' @@ -34,16 +30,15 @@ jobs: # Release process - name: Release run: | - echo ${{env.PACKAGE}} npm ci git config --global user.name "Automated NPM Release" git config --global user.email "sysadmin+npm-deploy@aligent.com.au" npm version $VERSION --allow-same-version --workspace "@aligent/cdk-${{env.PACKAGE}}" npm run build --workspace "@aligent/cdk-${{env.PACKAGE}}" npm test --workspace "@aligent/cdk-${{env.PACKAGE}}" --if-present - # npm publish --access public --workspace "@aligent/cdk-${{env.PACKAGE}}" - # env: - # NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - # - run: git push - # env: - # github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + npm publish --access public --workspace "@aligent/cdk-${{env.PACKAGE}}" + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - run: git push + env: + github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From c54da6992556a16566f32eb3d69ca6f35b5856a4 Mon Sep 17 00:00:00 2001 From: Krishan Thisera Date: Fri, 8 Jul 2022 16:34:52 +0930 Subject: [PATCH 13/13] DO-1285: Release docs --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 32bc6e3a..dc5bfd9a 100644 --- a/README.md +++ b/README.md @@ -11,3 +11,25 @@ Construct | Description [rabbitmq](packages/rabbitmq) | [static-hosting](packages/static-hosting) | [waf](packages/waf) | + +## Making a Release + +Each construct/package maintains an independent release cycle. +Once the changes have been approved, you can commit/merge the changes to the main branch and create a release. +**Note that for all the finalized releases, the source branch should be the main branch.** + +If the release is experimental, you may use the `main` or the feature branch. + +### Release Tags + +When making a release (including experimental releases), the release tag should maintain following formation. + +- experimental releases: [package-name]-[version number]-[experimental tag] +- finalized releases: [package-name]-[version number] + +**Note that the version number should follow `[0-9].[0-9].[0-9]` structure.** + +| | | +|---------------|---------------| +| Experimental | 1.1.0-beta | +| Final | 1.1.0 |