From a76b1cb724f0f9f6ff5b23a44caaa0445f02772e Mon Sep 17 00:00:00 2001 From: Julio Guerra Date: Fri, 30 Dec 2022 11:22:27 +0100 Subject: [PATCH] ci: auto trigger major workflows on release branches (#1631) --- .github/workflows/appsec.yml | 2 + .github/workflows/govulncheck.yml | 1 + .github/workflows/parametric-tests.yml | 1 + .github/workflows/release-candidate.yml | 52 ----------------------- .github/workflows/release-start.yml | 56 ------------------------- .github/workflows/smoke-tests.yml | 2 +- .github/workflows/system-tests.yml | 1 + 7 files changed, 6 insertions(+), 109 deletions(-) delete mode 100644 .github/workflows/release-candidate.yml delete mode 100644 .github/workflows/release-start.yml diff --git a/.github/workflows/appsec.yml b/.github/workflows/appsec.yml index b6c164f8bf..7fccdbbf5f 100644 --- a/.github/workflows/appsec.yml +++ b/.github/workflows/appsec.yml @@ -9,6 +9,8 @@ on: - 'internal/appsec/**' - 'appsec/**' - 'contrib/**/appsec.go' + push: + branches: release-v* env: DD_APPSEC_WAF_TIMEOUT: 5s GODEBUG: cgocheck=2 diff --git a/.github/workflows/govulncheck.yml b/.github/workflows/govulncheck.yml index 5119020fa6..e1b5a86eae 100644 --- a/.github/workflows/govulncheck.yml +++ b/.github/workflows/govulncheck.yml @@ -3,6 +3,7 @@ on: push: branches: - main + - release-v* schedule: - cron: '00 00 * * *' workflow_dispatch: diff --git a/.github/workflows/parametric-tests.yml b/.github/workflows/parametric-tests.yml index 07b4674dc7..ffab6c3c21 100644 --- a/.github/workflows/parametric-tests.yml +++ b/.github/workflows/parametric-tests.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - release-v* tags: - "**" pull_request: diff --git a/.github/workflows/release-candidate.yml b/.github/workflows/release-candidate.yml deleted file mode 100644 index 4e997f38d4..0000000000 --- a/.github/workflows/release-candidate.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Release / Publish a new release candidate (bot) - -on: - workflow_dispatch: - inputs: - release-branch: - description: 'Release branch to create release candidate from' - required: true - -jobs: - bump_rc_and_tag: - name: Create and publish a new release candidate version - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BRANCH: ${{ github.event.inputs.release-branch }} - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version: '>=1.17.0' - - - name: Check the branch name - run: | - [[ "$BRANCH" =~ release-v[0-9]+\.[0-9]+\.x ]] - - - name: Configure git - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - git fetch --tags origin $BRANCH - git checkout $BRANCH - - - name: Read the version.go file - id: version - run: go run .github/workflows/apps/parse/parse_version.go - - - name: Update the version.go file in the release branch to ${{ steps.version.outputs.next_rc }} - env: - VERSION: ${{ steps.version.outputs.next_rc }} - run: | - go run .github/workflows/apps/update_version_file.go $VERSION - git add --all - git commit -m "update version to $VERSION" - - - name: Create the git tag ${{ steps.version.outputs.next_rc }} - env: - VERSION: ${{ steps.version.outputs.next_rc }} - run: git tag -m "$VERSION - Automated RC" $VERSION - - - name: Push the branch and tag - run: git push --tags origin $BRANCH diff --git a/.github/workflows/release-start.yml b/.github/workflows/release-start.yml deleted file mode 100644 index 0c2fffb7d3..0000000000 --- a/.github/workflows/release-start.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Release / Start a new minor release - -on: - workflow_dispatch: - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -jobs: - start: - name: Start a new release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 - with: - go-version: '>=1.17.0' - - - name: Configure git - run: | - git config user.name "$GITHUB_ACTOR" - git config user.email "$GITHUB_ACTOR@users.noreply.github.com" - git fetch origin main - git checkout main - - - name: Read the version.go file - id: version - run: go run .github/workflows/apps/parse/parse_version.go - - - name: Create the release branch release-${{ steps.version.outputs.current_without_patch }} - env: - BRANCH: release-${{ steps.version.outputs.current_without_patch }} - run: | - git checkout -b $BRANCH - git push -u origin $BRANCH - - - name: Create the release note draft - id: release_note - env: - VERSION: ${{ steps.version.outputs.current }} - BRANCH: release-${{ steps.version.outputs.current_without_patch}} - run: | - url=$(gh release create $VERSION --title="$VERSION" --draft --generate-notes --target="$BRANCH" --notes-start-tag="${{ steps.version.outputs.current }}") - echo $url - echo "::set-output name=url::$url" - - - - name: Create the next release GitHub milestone ${{ steps.version.outputs.next_minor }} - env: - NEXT_VERSION: ${{ steps.version.outputs.next_minor }} - run: | - gh api /repos/$GITHUB_REPOSITORY/milestones \ - --method POST \ - -f title="$NEXT_VERSION" \ - -f state='open' \ - -f description="Tracking milestone for version $NEXT_VERSION" || true # ignore if already exists diff --git a/.github/workflows/smoke-tests.yml b/.github/workflows/smoke-tests.yml index 32fab179a4..c6e6b46447 100644 --- a/.github/workflows/smoke-tests.yml +++ b/.github/workflows/smoke-tests.yml @@ -4,7 +4,7 @@ on: push: branches: - main - - release-* + - release-v* tags: - '**' schedule: # nightly diff --git a/.github/workflows/system-tests.yml b/.github/workflows/system-tests.yml index 5b22dd301f..7692e3ae1e 100644 --- a/.github/workflows/system-tests.yml +++ b/.github/workflows/system-tests.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - release-v* tags: - "**" pull_request: