-
Notifications
You must be signed in to change notification settings - Fork 3
Setup release-please
#65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c310ed7
chore: configure release-please for helm charts
garryod 70d0369
chore: configure release-please for reusable workflows
garryod d33094e
ci: setup release please CI workflow
garryod 77f9647
ci: ignore generated changelogs when linting markdown
garryod 6c4bc5f
chore: configure release-please for schema updates
garryod bb86ad4
ci: generate supergraph version with release-please
garryod File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,7 @@ jobs: | |
| run: > | ||
| markdownlint-cli2 | ||
| "**/*.{md,markdown}" | ||
| "#**/CHANGELOG.md" | ||
|
|
||
| build: | ||
| needs: lint | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: Release Please | ||
|
|
||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| GRAPH_FEDERATOR: | ||
| required: true | ||
|
|
||
| jobs: | ||
| release_please: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
| id-token: write | ||
| steps: | ||
| - name: Checkout source | ||
| uses: actions/checkout@v4.2.2 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Create GitHub App Token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@v1.11.0 | ||
| with: | ||
| app-id: 1010045 | ||
| private-key: ${{ secrets.GRAPH_FEDERATOR }} | ||
| repositories: graph-federation | ||
|
|
||
| - name: Release Please | ||
| id: release | ||
| uses: googleapis/release-please-action@v4.1.3 | ||
| with: | ||
| token: ${{ steps.app-token.outputs.token }} | ||
| config-file: release-please-config.json | ||
| manifest-file: .release-please-manifest.json | ||
| fork: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| const releasePlease = require('release-please'); | ||
| const simpleGit = require('simple-git'); | ||
|
|
||
| module.exports = async ({github, context, token}) => { | ||
| const ghRelease = await releasePlease.GitHub.create({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| token: token, | ||
| }); | ||
|
|
||
| const manifest = await releasePlease.Manifest.fromManifest( | ||
| ghRelease, | ||
| ghRelease.repository.defaultBranch, | ||
| 'release-please-config.json', | ||
| '.release-please-manifest.json', | ||
| {} | ||
| ); | ||
|
|
||
| const pullRequests = await manifest.buildPullRequests(); | ||
| const pullRequest = pullRequests.find((pullRequest) => pullRequest.updates.some((update) => update.path === 'charts/supergraph/Chart.yaml')); | ||
| console.log(`Supergraph Pull Request: ${JSON.stringify(pullRequest)}`); | ||
|
|
||
| const git = simpleGit(); | ||
| const lastTag = await git.raw('describe', '--tags', '--match', 'supergraph@v*', 'HEAD').catch((err) => undefined); | ||
| console.log(`Last Tag: ${JSON.stringify(lastTag)}`); | ||
| const commitsSince = lastTag ? await git.raw('rev-list', `${lastTag}..HEAD`, '--count') : await git.raw('rev-list', '--count', '--all'); | ||
| console.log(`Commits Since: ${commitsSince}`); | ||
|
|
||
| let rcVersion = ''; | ||
| if (pullRequest !== undefined) { | ||
|
|
||
| const releaseData = pullRequest.body.releaseData.find((release) => release.component === 'supergraph-schema'); | ||
| rcVersion = commitsSince !== 0 ? `${releaseData.version.major}.${releaseData.version.minor}.${releaseData.version.patch}-rc${commitsSince}` : `${releaseData.version.major}.${releaseData.version.minor}.${releaseData.version.patch}`; | ||
| console.log(`Release Candidate Version: ${rcVersion}`); | ||
| } else if (lastTag !== undefined && commitsSince === 0) { | ||
| rcVersion = lastTag.split("@v").pop(); | ||
| }; | ||
|
|
||
| return rcVersion | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| { | ||
| "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", | ||
| "bootstrap-sha": "ee1cb51e2177608be9e291f6bde17ca5d867016e", | ||
| "include-component-in-tag": true, | ||
| "include-v-in-tag": true, | ||
| "tag-separator": "@", | ||
| "separate-pull-requests": true, | ||
| "bump-minor-pre-major": true, | ||
| "bump-patch-for-minor-pre-major": true, | ||
| "packages": { | ||
| "charts/apps": { | ||
| "release-type": "helm", | ||
| "release-as": "0.2.2" | ||
| }, | ||
| "charts/graph": { | ||
| "release-type": "helm", | ||
| "release-as": "0.11.1" | ||
| }, | ||
| "charts/monitoring": { | ||
| "release-type": "helm", | ||
| "release-as": "0.2.0" | ||
| }, | ||
| "charts/supergraph": { | ||
| "release-type": "helm", | ||
| "component": "supergraph" | ||
| }, | ||
| "schema": { | ||
| "package-name": "supergraph-schema", | ||
| "release-type": "simple", | ||
| "component": "supergraph-schema" | ||
| }, | ||
| "workflows/compose": { | ||
| "package-name": "compose", | ||
| "release-type": "simple", | ||
GDYendell marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "release-as": "0.1.0" | ||
| }, | ||
| "workflows/update": { | ||
| "package-name": "update", | ||
| "release-type": "simple", | ||
| "release-as": "0.1.0" | ||
| } | ||
| }, | ||
| "plugins": [ | ||
| { | ||
| "type": "linked-versions", | ||
| "groupName": "supergraph", | ||
| "components": [ | ||
| "supergraph", | ||
| "supergraph-schema" | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.