diff --git a/.github/terraform-maintainers b/.github/terraform-maintainers deleted file mode 100644 index 84f609a..0000000 --- a/.github/terraform-maintainers +++ /dev/null @@ -1,3 +0,0 @@ -matttrach -jiaqiluo -HarrisonWAffel diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index a3b0404..874bd59 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -7,26 +7,20 @@ on: jobs: create-issue: runs-on: ubuntu-latest - if: ${{ github.event.label.name == 'version/v0' }} + if: ${{ startsWith(github.event.label.name, 'release/v') }} steps: - name: Create GitHub Issue uses: actions/github-script@v7 with: script: | + const labelName = context.payload.label.name; const parentIssue = context.payload.issue; const parentIssueTitle = parentIssue.title; const parentIssueNumber = parentIssue.number; const repo = context.repo.repo; const owner = context.repo.owner; const parentIssueBody = parentIssue.body; - - const fs = require('fs'); // Import the Node.js file system module - const fileContent = fs.readFileSync('.github/terraform-maintainers', 'utf8'); - const assignees = fileContent.split('\n').map(u => u.trim()).filter(Boolean); - if (assignees.length === 0) { - console.log('No assignees found in the team file.'); - return; - } + const assignees = ['matttrach', 'jiaqiluo', 'HarrisonWAffel'] if (!parentIssueBody) { core.setFailed('Issue body is empty.'); @@ -46,9 +40,9 @@ jobs: const newIssue = await github.rest.issues.create({ owner: owner, repo: repo, - title: `Backport #${prNumber} to release/v0`, - body: `Backport #${prNumber} to release/v0 for #${parentIssueNumber}`, - labels: ['release/v0'], + title: `Backport #${prNumber} to ${labelName}`, + body: `Backport #${prNumber} to ${labelName} for #${parentIssueNumber}`, + labels: [labelName], assignees: assignees }); diff --git a/.github/workflows/main-issue.yml b/.github/workflows/main-issue.yml index 2a8d2cc..8d565c5 100644 --- a/.github/workflows/main-issue.yml +++ b/.github/workflows/main-issue.yml @@ -21,16 +21,9 @@ jobs: const newLabels = ['internal/main']; const releaseLabel = pr.labels.find(label => label.name.startsWith('release/v')); if (releaseLabel) { - const versionLabel = releaseLabel.name.replace('release/', 'version/'); - newLabels.push(versionLabel); - } - const fs = require('fs'); // Import the Node.js file system module - const fileContent = fs.readFileSync('.github/terraform-maintainers', 'utf8'); - const assignees = fileContent.split('\n').map(u => u.trim()).filter(Boolean); - if (assignees.length === 0) { - console.log('No assignees found in the team file.'); - return; + newLabels.push(releaseLabel); } + const assignees = ['matttrach', 'jiaqiluo', 'HarrisonWAffel'] // Note: can't get terraform-maintainers team, the default token can't access org level objects // Create the main issue @@ -57,9 +50,9 @@ jobs: const newSubIssue = await github.rest.issues.create({ owner: owner, repo: repo, - title: `Backport #${pr.number} to release/v0`, - body: `Backport #${pr.number} to release/v0 for #${parentIssueNumber}`, - labels: ['release/v0'], + title: `Backport #${pr.number} to ${releaseLabel}`, + body: `Backport #${pr.number} to ${releaseLabel} for #${parentIssueNumber}`, + labels: [releaseLabel], assignees: assignees }); const subIssueId = newSubIssue.data.id; diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f0a959c..cabdc7d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,7 @@ name: release on: push: branches: - - release/v0 - - release/v1 + - release/v* jobs: release: @@ -23,6 +22,9 @@ jobs: id: release-please with: release-type: go + target-branch: ${{ github.ref_name }} + config-file: release-please-config.json + manifest-file: .release-please-manifest.json # These run only if a release PR was opened or modified, so not when the PR is merged - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 https://github.com/actions/github-script/commits/main name: wait-for-e2e diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..f0ec2a7 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + "./": "0.1.0" +} diff --git a/flake.lock b/flake.lock index 3476040..ab045cb 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1756035328, - "narHash": "sha256-vC7SslUBCtdT3T37ZH3PLIWYmTkSeppL5BJJByUjYCM=", + "lastModified": 1756128520, + "narHash": "sha256-R94HxJBi+RK1iCm8Y4Q9pdrHZl0GZoDPIaYwjxRNPh4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6b0b1559e918d4f7d1df398ee1d33aeac586d4d6", + "rev": "c53baa6685261e5253a1c355a1b322f82674a824", "type": "github" }, "original": { diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..7bce179 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,5 @@ +{ + "packages": { + "./": {} + } +}