From fcd799adff2e805fbedbfb402c20701e07b395cb Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Thu, 29 Feb 2024 14:14:52 +0800 Subject: [PATCH] chore: require approval for release job --- .github/workflows/release.yml | 16 +++++++++------- .github/workflows/test.yml | 16 ++++++++-------- .goreleaser.yml | 13 +++++++++++-- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3eb4d1f..09f4196 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,27 +15,29 @@ permissions: jobs: goreleaser: + environment: production runs-on: ubuntu-latest steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@v4 with: # Allow goreleaser to access older tag information. fetch-depth: 0 - - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + - uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true - - name: Import GPG key - uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0 - id: import_gpg + - id: import_gpg + uses: crazy-max/ghaction-import-gpg@v6 with: gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} passphrase: ${{ secrets.PASSPHRASE }} - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 + - uses: goreleaser/goreleaser-action@v5 with: args: release --clean env: # GitHub sets the GITHUB_TOKEN secret automatically. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + - run: gh release edit ${{ github.ref_name }} --draft=false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce793ac..6c70d1d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,23 +24,23 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true - run: go mod download - run: go build -v . - name: Run linters - uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0 + uses: golangci/golangci-lint-action@v3 with: version: latest generate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true @@ -67,12 +67,12 @@ jobs: - '1.3.*' - '1.4.*' steps: - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 + - uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: go-version-file: 'go.mod' cache: true - - uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3 + - uses: hashicorp/setup-terraform@v2 with: terraform_version: ${{ matrix.terraform }} terraform_wrapper: false diff --git a/.goreleaser.yml b/.goreleaser.yml index 9bb0aa7..426aca4 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -55,6 +55,15 @@ release: - glob: 'terraform-registry-manifest.json' name_template: '{{ .ProjectName }}_{{ .Version }}_manifest.json' # If you want to manually examine the release before its live, uncomment this line: - # draft: true + draft: true changelog: - skip: true + use: github + groups: + - title: Features + regexp: '^.*?feat(\([[:word:]]+\))??!?:.+$' + order: 0 + - title: "Bug fixes" + regexp: '^.*?fix(\([[:word:]]+\))??!?:.+$' + order: 1 + - title: Others + order: 999