diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9ee80e5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,72 @@ +name: Release + +on: + workflow_dispatch: + inputs: + version: + description: 'Version (excl. prefix v)' + required: true + type: string + sha: + description: 'SHA (long version; 40 chars)' + required: true + type: string + branch: + description: 'Branch' + type: string + default: main + +jobs: + staging: + runs-on: ubuntu-latest + steps: + - name: Setup bob + uses: hashicorp/action-setup-bob@v1 + with: + github-token: + ${{ secrets.BOB_GITHUB_TOKEN }} + - name: Promote to staging + env: + BOB_GITHUB_TOKEN: ${{ secrets.BOB_GITHUB_TOKEN }} + VERSION: ${{ github.event.inputs.version }} + SHA: ${{ github.event.inputs.sha }} + BRANCH: main + ENVIRONMENT: staging + run: | + bob trigger-promotion \ + --product-name=hc-install \ + --environment=hc-install-oss \ + --org=hashicorp \ + --repo=hc-install \ + --slack-channel=C01QDH3Q37W \ + --product-version=$VERSION \ + --sha=$SHA \ + --branch=$BRANCH \ + $ENVIRONMENT + + production: + runs-on: ubuntu-latest + steps: + - name: Setup bob + uses: hashicorp/action-setup-bob@v1 + with: + github-token: + ${{ secrets.BOB_GITHUB_TOKEN }} + - name: Promote to production + env: + BOB_GITHUB_TOKEN: ${{ secrets.BOB_GITHUB_TOKEN }} + VERSION: ${{ github.event.inputs.version }} + SHA: ${{ github.event.inputs.sha }} + BRANCH: main + ENVIRONMENT: production + run: | + bob trigger-promotion \ + --product-name=hc-install \ + --environment=hc-install-oss \ + --org=hashicorp \ + --repo=hc-install \ + --slack-channel=C01QDH3Q37W \ + --product-version=$VERSION \ + --sha=$SHA \ + --branch=$BRANCH \ + $ENVIRONMENT diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index b6e3f90..23ce140 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -8,33 +8,6 @@ Release process: 1. Update [`version/VERSION`](https://github.com/hashicorp/hc-install/blob/main/version/VERSION) to remove `-dev` suffix and set it to the intended version to be released 1. Wait for [`build` workflow](https://github.com/hashicorp/hc-install/actions/workflows/build.yml) to finish - 1. Ensure you have the appropriate GitHub PAT set in `BOB_GITHUB_TOKEN` variable - 1. Set `SHA` to the corresponding (long) last commit SHA (after updating `VERSION` file) & `VERSION` to the same version - 1. Use `bob` to promote artifacts to **staging** - ``` -bob trigger-promotion \ - --product-name=hc-install \ - --environment=hc-install-oss \ - --org=hashicorp \ - --repo=hc-install \ - --slack-channel=C01QDH3Q37W \ - --product-version=$VERSION \ - --sha=$SHA \ - --branch=main \ - staging - ``` - 6. Use `bob` to promote artifacts to **production** - ``` -bob trigger-promotion \ - --product-name=hc-install \ - --environment=hc-install-oss \ - --org=hashicorp \ - --repo=hc-install \ - --slack-channel=C01QDH3Q37W \ - --product-version=$VERSION \ - --sha=$SHA \ - --branch=main \ - production - ``` -7. Wait for a message in the Slack channel saying that authorisation is needed to promote artifacts to production. Click on the link and approve. -8. Once notified that promotion is successful, go to https://github.com/hashicorp/crt-workflows-common/actions/workflows/promote-production-packaging.yml, locate the hc-install promote-production-packaging workflow, and approve. + 1. Run the Release workflow with the appropriate version (matching the one in `version/VERSION`) & SHA (long one). + 1. Wait for a message in the Slack channel saying that authorisation is needed to promote artifacts to production. Click on the link and approve. + 1. Once notified that promotion is successful, go to https://github.com/hashicorp/crt-workflows-common/actions/workflows/promote-production-packaging.yml, locate the hc-install promote-production-packaging workflow, and approve.