diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 743b3706..f3174b2f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,20 @@ on: release: types: [published] jobs: + validate-tag: + runs-on: ubuntu-latest + steps: + - uses: actions-ecosystem/action-regex-match@v2 + id: tag-match + with: + text: ${{ github.event.release.tag_name }} + regex: '^\d+\.\d+\.\d+$' + - run: echo "Please create tag for release with format like 4.0.1" && exit 1 + if: ${{ steps.tag-match.outputs.match == '' }} + # Build package and publish a prerelease prerelease: + needs: validate-tag permissions: id-token: write runs-on: ubuntu-latest diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 28753179..a88e63b9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -74,9 +74,9 @@ Both packages [checkly](https://www.npmjs.com/package/checkly) and [create-cli]( To release packages to NPM: -1. Publish a Github Release with a valid tag `v#.#.#` and click the `Generate release notes` button to auto-generate notes following format defined [here](https://github.com/checkly/checkly-cli/blob/main/.github/release.yml) -2. When release is published the Github action is triggered. It builds and publishes `v#.#.#-prerelease` prereleases (for both packages). -3. A `production` deployment will be waiting for approval. After it's approved, the `v#.#.#` version will be published and set as `latest` +1. Publish a Github Release with a valid tag `#.#.#` and click the `Generate release notes` button to auto-generate notes following format defined [here](https://github.com/checkly/checkly-cli/blob/main/.github/release.yml) +2. When release is published the Github action is triggered. It builds and publishes `#.#.#-prerelease` prereleases (for both packages). +3. A `production` deployment will be waiting for approval. After it's approved, the `#.#.#` version will be published and set as `latest` ## Style Guide