-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from open-feature/add-release-process
ci: add release process
- Loading branch information
Showing
6 changed files
with
222 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,12 @@ | ||
name: DCO | ||
on: | ||
merge_group: | ||
|
||
permissions: # set top-level default permissions as security best practice | ||
contents: read # Check https://github.com/ossf/scorecard/blob/7ce8609469289d5f3b1bf5ee3122f42b4e3054fb/docs/checks.md#token-permissions | ||
|
||
jobs: | ||
DCO: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: echo "skipping DCO check for the merge group" |
This file contains 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,47 @@ | ||
name: "Lint PR" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
main: | ||
permissions: | ||
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs | ||
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
id: lint_pr_title | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: marocchino/sticky-pull-request-comment@v2 | ||
# When the previous steps fails, the workflow would stop. By adding this | ||
# condition you can continue the execution with the populated error message. | ||
if: always() && (steps.lint_pr_title.outputs.error_message != null) | ||
with: | ||
header: pr-title-lint-error | ||
message: | | ||
Hey there and thank you for opening this pull request! 👋🏼 | ||
We require pull request titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/) and it looks like your proposed title needs to be adjusted. | ||
Details: | ||
``` | ||
${{ steps.lint_pr_title.outputs.error_message }} | ||
``` | ||
# Delete a previous comment when the issue has been resolved | ||
- if: ${{ steps.lint_pr_title.outputs.error_message == null }} | ||
uses: marocchino/sticky-pull-request-comment@v2 | ||
with: | ||
header: pr-title-lint-error | ||
delete: true |
This file contains 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,91 @@ | ||
name: Run Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }} | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # for googleapis/release-please-action to create release commit | ||
pull-requests: write # for googleapis/release-please-action to create release PR | ||
# Release-please creates a PR that tracks all changes | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
id: release | ||
with: | ||
command: manifest | ||
token: ${{secrets.RELEASE_PLEASE_ACTION_TOKEN}} | ||
default-branch: main | ||
signoff: "OpenFeature Bot <109696520+openfeaturebot@users.noreply.github.com>" | ||
- name: Dump Release Please Output | ||
env: | ||
RELEASE_PLEASE_OUTPUT: ${{ toJSON(steps.release.outputs) }} | ||
run: | | ||
echo "$RELEASE_PLEASE_OUTPUT" | ||
outputs: | ||
release_created: ${{ steps.release.outputs.release_created }} | ||
release_tag_name: ${{ steps.release.outputs.tag_name }} | ||
upload_url: ${{ steps.release.outputs.upload_url }} | ||
|
||
release: | ||
needs: release-please | ||
if: ${{ fromJSON(needs.release-please.outputs.release_created || false) }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ needs.release-please.outputs.release_tag_name }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/#-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
tags: | | ||
type=schedule | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
type=sha | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
platforms: linux/amd64,linux/arm64 | ||
|
||
- name: Build and Push Container | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
provenance: mode=max | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains 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,3 @@ | ||
{ | ||
".": "0.0.1" | ||
} |
This file contains 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 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,67 @@ | ||
{ | ||
"release-type": "simple", | ||
"packages": { | ||
".": { | ||
"monorepo-tags": false, | ||
"include-component-in-tag": false, | ||
"prerelease": false, | ||
"bump-minor-pre-major": false, | ||
"bump-patch-for-minor-pre-major": false | ||
} | ||
}, | ||
"changelog-sections": [ | ||
{ | ||
"type": "fix", | ||
"section": "🐛 Bug Fixes" | ||
}, | ||
{ | ||
"type": "feat", | ||
"section": "✨ New Features" | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "🧹 Chore" | ||
}, | ||
{ | ||
"type": "docs", | ||
"section": "📚 Documentation" | ||
}, | ||
{ | ||
"type": "perf", | ||
"section": "🚀 Performance" | ||
}, | ||
{ | ||
"type": "build", | ||
"hidden": true, | ||
"section": "🛠️ Build" | ||
}, | ||
{ | ||
"type": "deps", | ||
"section": "📦 Dependencies" | ||
}, | ||
{ | ||
"type": "ci", | ||
"hidden": true, | ||
"section": "🚦 CI" | ||
}, | ||
{ | ||
"type": "refactor", | ||
"section": "🔄 Refactoring" | ||
}, | ||
{ | ||
"type": "revert", | ||
"section": "🔙 Reverts" | ||
}, | ||
{ | ||
"type": "style", | ||
"hidden": true, | ||
"section": "🎨 Styling" | ||
}, | ||
{ | ||
"type": "test", | ||
"hidden": true, | ||
"section": "🧪 Tests" | ||
} | ||
], | ||
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" | ||
} |