diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 665e43f71b4..00000000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: GoTest - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - - build: - name: Build - runs-on: ubuntu-latest - steps: - - - name: Set up Go 1.x - uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8 - with: - go-version: ^1.16 - - - name: Check out code into the Go module directory - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - - - name: Get dependencies - run: | - go mod download - - - name: Build - run: | - make lint - make generate - go build - - - name: Test - run: | - make docscheck - make test diff --git a/.github/workflows/issue-comment-created.yml b/.github/workflows/issue-comment-created.yml deleted file mode 100644 index 62b9c619418..00000000000 --- a/.github/workflows/issue-comment-created.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Issue Comment Created Triage - -on: - issue_comment: - types: [created] - -jobs: - remove_waiting_response: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - - uses: actions-ecosystem/action-remove-labels@556e306654eb4c343ecaff657772edaa3f1add86 - with: - github_token: "${{ secrets.GITHUB_TOKEN }}" - labels: waiting-response diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml deleted file mode 100644 index b116f29c56c..00000000000 --- a/.github/workflows/labeler.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Issue Opened Triage - -on: - issues: - types: [opened] - -jobs: - triage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f - - uses: github/issue-labeler@a326d12b9b64d4395a18e50f648214c609501643 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/labeler.yml - enable-versioned-regex: false diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml deleted file mode 100644 index 79475c6c914..00000000000 --- a/.github/workflows/lock.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: 'Lock Threads' - -on: - schedule: - - cron: '50 1 * * *' - -jobs: - lock: - runs-on: ubuntu-latest - steps: - - uses: dessant/lock-threads@486f7380c15596f92b724e4260e4981c68d6bde6 - with: - github-token: ${{ github.token }} - issue-lock-comment: > - I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. - - If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. - issue-lock-inactive-days: '30' - pr-lock-comment: > - I'm going to lock this pull request because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. - - If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. - pr-lock-inactive-days: '30' diff --git a/.github/workflows/pull-request-reviewer.yml b/.github/workflows/pull-request-reviewer.yml deleted file mode 100644 index 50c6ab80b7e..00000000000 --- a/.github/workflows/pull-request-reviewer.yml +++ /dev/null @@ -1,17 +0,0 @@ -# name: "Pull Request Reviewer" -# on: -# pull_request_target: -# types: [opened, ready_for_review, reopened] - -# permissions: -# pull-requests: write - -# jobs: -# test: -# if: ${{ github.actor != 'modular-magician' }} -# runs-on: ubuntu-latest -# steps: -# - uses: actions/checkout@v2 -# - uses: uesteibar/reviewer-lottery@5531ef7fe55d814c8f8fbab12de4ff74d15b41ed -# with: -# repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pull-request-size.yml b/.github/workflows/pull-request-size.yml deleted file mode 100644 index f5e2dc70f9f..00000000000 --- a/.github/workflows/pull-request-size.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "Pull Request Size Labeler" - -on: [pull_request] - -jobs: - labeler: - runs-on: ubuntu-latest - name: Label the PR size - steps: - - uses: codelytv/pr-size-labeler@417e60a06bd915dd3d96ec4aa105f7d753a8f974 - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - xs_max_size: '30' - s_max_size: '60' - m_max_size: '150' - l_max_size: '300' - message_if_xl: '' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f4e469b30a2..331eccff7b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,51 +1,61 @@ -name: Release +name: Build TF Provider -on: - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+*' - -permissions: - contents: write +on: [push] jobs: - go-version: + build: runs-on: ubuntu-latest - outputs: - version: ${{ steps.go-version.outputs.version }} steps: - - uses: actions/checkout@v2 - - id: go-version - run: echo "::set-output name=version::$(cat ./.go-version)" - release-notes: + - uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version: 1.21.3 + - name: Install C toolchain + run: | + sudo apt-get update + sudo apt install -y gcc-x86-64-linux-gnu + mkdir bin + - name: Cache Binaries + uses: actions/cache@v2 + env: + cache-name: cache-binaries + with: + path: bin + key: ${{ github.sha }} + restore-keys: ${{ github.sha }} + - name: Build Linux binary with Boringcrypto + run: | + CC=x86_64-linux-gnu-gcc CGO_ENABLED=1 GOARCH=amd64 GOOS=linux GOEXPERIMENT=boringcrypto \ + go build -o bin/terraform-provider-google.linux.amd64 . + - name: Verify Boringcrypto + run: | + go run rsc.io/goversion@master -crypto bin/terraform-provider-google.linux.amd64 | grep -q '(boring crypto)' + # boringcrypto isn't available for darwin, so we can also disable CGO. + - name: Build Darwin binary without Boringcrypto + run: | + CGO_ENABLED=0 GOARCH=arm64 GOOS=darwin \ + go build -o bin/terraform-provider-google.darwin.arm64 . + release: runs-on: ubuntu-latest + needs: build + if: github.ref == 'refs/heads/snyk-v1' + permissions: + contents: write steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + - name: Cache Binaries + uses: actions/cache@v2 + env: + cache-name: cache-binaries with: - fetch-depth: 0 - - name: Generate Release Notes - run: sed -n -e "1{/# /d;}" -e "2{/^$/d;}" -e "/# $(git describe --abbrev=0 --exclude="$(git describe --abbrev=0 --match='v*.*.*' --tags)" --match='v*.*.*' --tags | tr -d v)/q;p" CHANGELOG.md > release-notes.txt - - uses: actions/upload-artifact@v2 + path: bin + key: ${{ github.sha }} + restore-keys: ${{ github.sha }} + - name: Create Release + uses: ncipollo/release-action@v1 with: - name: release-notes - path: release-notes.txt - retention-days: 1 - terraform-provider-release: - name: 'Terraform Provider Release' - needs: [go-version, release-notes] - uses: hashicorp/ghaction-terraform-provider-release/.github/workflows/hashicorp.yml@v2 - secrets: - hc-releases-github-token: '${{ secrets.HASHI_RELEASES_GITHUB_TOKEN }}' - hc-releases-host-staging: '${{ secrets.HC_RELEASES_HOST_STAGING }}' - hc-releases-host-prod: '${{ secrets.HC_RELEASES_HOST_PROD }}' - hc-releases-key-prod: '${{ secrets.HC_RELEASES_KEY_PROD }}' - hc-releases-key-staging: '${{ secrets.HC_RELEASES_KEY_STAGING }}' - hc-releases-terraform-registry-sync-token: '${{ secrets.TF_PROVIDER_RELEASE_TERRAFORM_REGISTRY_SYNC_TOKEN }}' - setup-signore-github-token: '${{ secrets.HASHI_SIGNORE_GITHUB_TOKEN }}' - signore-client-id: '${{ secrets.SIGNORE_CLIENT_ID }}' - signore-client-secret: '${{ secrets.SIGNORE_CLIENT_SECRET }}' - with: - release-notes: true - setup-go-version: '${{ needs.go-version.outputs.version }}' - # Product Version (e.g. v1.2.3 or github.ref_name) - product-version: '${{ github.ref_name }}' + tag: v0.0.0-${{ github.sha }} + commit: ${{ github.sha }} + artifacts: bin/terraform-provider-google.*.* + makeLatest: true diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 8a96f8f3846..00000000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: 'Close stale issues and PRs' -on: - schedule: - - cron: '10 3 * * *' - -jobs: - stale: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@98ed4cb500039dbcccf4bd9bedada4d0187f2757 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 9999 - days-before-close: 90 - stale-issue-label: 'stale' - stale-pr-label: 'stale' - close-issue-message: | - I'm going to close this issue due to inactivity (_90 days_ without response ⏳ ). This helps our maintainers find and focus on the active issues. - - If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you! - - close-pr-message: | - I'm going to close this pull requests due to inactivity (_90 days_ without response ⏳ ). This helps our maintainers find and focus on the active contributions. - - If this pull request was automatically closed and you feel this pull request should be reopened, we encourage creating a new pull request linking back to this one for added context. Thank you! diff --git a/.github/workflows/upstream-mm.yml b/.github/workflows/upstream-mm.yml deleted file mode 100644 index eae4bdd80c7..00000000000 --- a/.github/workflows/upstream-mm.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: "Upstream To MM" -on: - pull_request_target: - types: [opened, ready_for_review, reopened] - -jobs: - pr-warning: - if: ${{ github.actor != 'modular-magician' }} - runs-on: ubuntu-latest - steps: - - name: Post the warning - uses: hashicorp/pr-warning@v1.0.0 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - warning: "This repository is generated by https://github.com/GoogleCloudPlatform/magic-modules. Any changes made directly to this repository will likely be overwritten. If you have further questions, please feel free to ping your reviewer or, internal employees, reach out to one of the engineers. Thank you!"