-
Notifications
You must be signed in to change notification settings - Fork 15
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 #40 from vlnevyhosteny/master
chore: release-please action
- Loading branch information
Showing
8 changed files
with
147 additions
and
12 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,70 @@ | ||
name: NuGet Publish | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
env: | ||
NUGET_DIR: ${{ github.workspace }}/nuget | ||
NUGET_ARTIFACT: nuget | ||
|
||
jobs: | ||
testing: | ||
if: contains(github.event.head_commit.message, 'chore(release)') | ||
uses: ./.github/workflows/test.yml | ||
|
||
pack: | ||
if: contains(github.event.head_commit.message, 'chore(release)') | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
|
||
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
|
||
- run: sed -E -i'.bak' 's:RepositoryCommit>.+</:RepositoryCommit>${{ github.sha }}</:g' ButterCMS/ButterCMS.csproj | ||
|
||
- run: dotnet pack --configuration Release --output "${{ env.NUGET_DIR }}" | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
name: ${{ env.NUGET_ARTIFACT }} | ||
path: ${{ env.NUGET_DIR }} | ||
if-no-files-found: error | ||
retention-days: 1 | ||
|
||
validate-nuget: | ||
runs-on: ubuntu-22.04 | ||
needs: pack | ||
steps: | ||
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
|
||
- uses: actions/[email protected] | ||
with: | ||
name: ${{ env.NUGET_ARTIFACT }} | ||
path: ${{ env.NUGET_DIR }} | ||
|
||
- name: Install nuget validator | ||
run: dotnet tool update Meziantou.Framework.NuGetPackageValidation.Tool --global | ||
|
||
- name: Validate nuget package | ||
run: meziantou.validate-nuget-package --excluded-rules Symbols ${{ env.NUGET_DIR }}/*.nupkg | ||
|
||
publish: | ||
runs-on: ubuntu-22.04 | ||
needs: [validate-nuget, testing] | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
name: ${{ env.NUGET_ARTIFACT }} | ||
path: ${{ env.NUGET_DIR }} | ||
|
||
- name: Setup .NET Core | ||
uses: actions/[email protected] | ||
|
||
- name: Publish nuget package | ||
run: dotnet nuget push "${{ env.NUGET_DIR }}/*.nupkg" --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json | ||
|
||
|
||
|
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,10 @@ | ||
name: Pull Request | ||
|
||
on: | ||
pull_request: | ||
types: [opened] | ||
|
||
jobs: | ||
testing: | ||
uses: ./.github/workflows/test.yml | ||
|
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,36 @@ | ||
# This workflow opens and updates a pull request with a new package version | ||
# based on code changes. | ||
|
||
# The pull request updates the version in ButterCMS/ButterCMS.csproj, | ||
# updates the version in README.md, updates the changelog and creates release tags. | ||
|
||
# For more information, see https://github.com/marketplace/actions/release-please-action | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
name: release-please | ||
|
||
jobs: | ||
testing: | ||
uses: ./.github/workflows/test.yml | ||
|
||
release-please: | ||
runs-on: ubuntu-22.04 | ||
needs: testing | ||
steps: | ||
- uses: google-github-actions/[email protected] | ||
with: | ||
release-type: simple | ||
package-name: release-please-action | ||
pull-request-title-pattern: 'chore(release): ${version}' | ||
pull-request-header: ':robot: Merge this PR to release a new version' | ||
extra-files: | | ||
README.md | ||
ButterCMS/ButterCMS.csproj |
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
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,11 @@ | ||
# Contributing | ||
|
||
## Release and publish a new SDK version | ||
|
||
This SDK uses the [`release-please` GitHub Action](https://github.com/google-github-actions/release-please-action) to automate preparing new versions for release. | ||
|
||
When you are ready to release a new SDK version, make sure that all your code changes have been approved and merged into the `master` branch and that your code is working. The `release-please` tool generates a changelog based on **commit messages; these messages should follow the [Conventional Commits](https://conventionalcommits.org) specification in order for the changelog to reflect all code changes accurately**. Otherwise, you would need to update the changelog manually before each release. Note that "chore" will not trigger a release PR. "fix" will create a SemVer Patch, "feat" will create a minor version, and adding a "!" will create a major version, indicating a breaking change. Find more information in the [release-please docs](https://github.com/google-github-actions/release-please-action#how-release-please-works). | ||
|
||
The `release-please` action opens and maintains a GitHub pull request with changes relevant to a new version release. Approve this pull request to release a new version of the SDK. | ||
|
||
After the release, the new version is automatically published into the npm registry (see the package [here](https://www.npmjs.com/package/buttercms)). |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.