-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: release-internal, until open-source chore: rename internal release workflow name ci: remove unneeded internal nuget repository (#86) ci: setup nuget publishing (#87) Update release-package.yml Create CHANGELOG.md chore: update CHANGELOG.md Update release-package.yml reset changelog chore: update CHANGELOG.md Update release-package.yml reset changelog chore: update CHANGELOG.md Update LEGO.AsyncAPI.csproj Update LEGO.AsyncAPI.Readers.csproj reset changelog chore: update CHANGELOG.md Update release-package.yml reset changelog chore: update CHANGELOG.md reset changelog
- Loading branch information
1 parent
04e8af8
commit 7ddecb8
Showing
7 changed files
with
94 additions
and
41 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
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,35 @@ | ||
name: Publish internal NuGet package | ||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- 'src/LEGO.AsyncAPI/**' | ||
- 'src/LEGO.AsyncAPI.Readers/**' | ||
- 'src/LEGO.AsyncAPI.Writers/**' | ||
- ".github/workflows/release-package.yml" | ||
- '!**/*.md' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
name: Publish NuGet packages | ||
strategy: | ||
matrix: | ||
package-name: [ "LEGO.AsyncAPI", "LEGO.AsyncAPI.Readers"] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
|
||
- name: Setup .NET Core @ Latest | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
source-url: https://nuget.pkg.github.com/LEGO/index.json | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: Build ${{ matrix.package-name }} project and pack NuGet package | ||
run: dotnet pack src/${{ matrix.package-name }}/${{ matrix.package-name }}.csproj -c Release -o out-${{ matrix.package-name }} -p:PackageVersion=0.2.$GITHUB_RUN_NUMBER.0-prerelease | ||
|
||
- name: Push generated package to GitHub Packages registry | ||
run: dotnet nuget push out-${{ matrix.package-name }}/*.nupkg --skip-duplicate -n --api-key ${{secrets.GITHUB_TOKEN}} |
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 |
---|---|---|
@@ -1,56 +1,74 @@ | ||
name: Publish a NuGet package | ||
name: Publish NuGet package | ||
on: | ||
# push: | ||
# branches: [ main ] | ||
# paths: | ||
# - 'src/LEGO.AsyncAPI/**' | ||
# - 'src/LEGO.AsyncAPI.Readers/**' | ||
# - ".github/workflows/release-package.yml" | ||
# - '!**/*.md' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
prereleaseCheck: | ||
runs-on: ubuntu-latest | ||
environment: AsyncAPI | ||
name: Check release | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v3 | ||
id: semantic | ||
with: | ||
extra_plugins: | | ||
conventional-changelog-conventionalcommits | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get token | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
id: get_token | ||
uses: peter-murray/[email protected] | ||
with: | ||
application_id: ${{ secrets.APPLICATION_ID }} | ||
application_private_key: ${{ secrets.APPLICATION_PRIVATE_KEY }} | ||
|
||
- name: Commit changes | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
env: | ||
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }} | ||
FILE_TO_COMMIT: CHANGELOG.md | ||
DESTINATION_BRANCH: ${{ github.ref }} | ||
run: | | ||
export MESSAGE="chore: update $FILE_TO_COMMIT" | ||
export SHA=$( git rev-parse $DESTINATION_BRANCH:$FILE_TO_COMMIT ) | ||
export CONTENT=$( base64 -i $FILE_TO_COMMIT ) | ||
gh api --method PUT /repos/:owner/:repo/contents/$FILE_TO_COMMIT \ | ||
--field message="$MESSAGE" \ | ||
--field content="$CONTENT" \ | ||
--field encoding="base64" \ | ||
--field branch="$DESTINATION_BRANCH" \ | ||
--field sha="$SHA" | ||
outputs: | ||
trigger_release: ${{ steps.semantic.outputs.new_release_published }} | ||
version: ${{ steps.semantic.outputs.new_release_published == 'true' && steps.semantic.outputs.new_release_version }} | ||
|
||
release: | ||
runs-on: ubuntu-latest | ||
name: Publish NuGet packages | ||
needs: prereleaseCheck | ||
environment: AsyncAPI | ||
strategy: | ||
matrix: | ||
package-name: [ "LEGO.AsyncAPI", "LEGO.AsyncAPI.Readers"] | ||
package-name: [ "LEGO.AsyncAPI", "LEGO.AsyncAPI.Readers" ] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v1 | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v3 | ||
id: semantic # Need an `id` for output variables | ||
with: | ||
extra_plugins: | | ||
conventional-changelog-conventionalcommits | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Setup .NET Core @ Latest | ||
if: needs.prereleaseCheck.outputs.trigger_release == 'true' | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
source-url: https://nuget.pkg.github.com/LEGO/index.json | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: Build ${{ matrix.package-name }} project and pack NuGet package | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
run: dotnet pack src/${{ matrix.package-name }}/${{ matrix.package-name }}.csproj -c Release -o out-${{ matrix.package-name }} -p:PackageVersion=${{ steps.semantic.outputs.new_release_version }}-prerelease | ||
if: needs.prereleaseCheck.outputs.trigger_release == 'true' | ||
run: dotnet pack src/${{ matrix.package-name }}/${{ matrix.package-name }}.csproj -c Release -o out-${{ matrix.package-name }} -p:PackageVersion=${{ needs.prereleaseCheck.outputs.version }} | ||
|
||
- name: Push generated package to GitHub Packages registry | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
run: dotnet nuget push out-${{ matrix.package-name }}/*.nupkg --skip-duplicate -n --api-key ${{secrets.GITHUB_TOKEN}} | ||
|
||
- name: Create Pull Request | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
id: pr | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
title: 'chore: update Changelog' | ||
base: main | ||
add-paths: | | ||
CHANGELOG.md | ||
if: needs.prereleaseCheck.outputs.trigger_release == 'true' | ||
run: dotnet nuget push out-${{ matrix.package-name }}/*.nupkg -s https://api.nuget.org/v3/index.json --skip-duplicate -n --api-key ${{secrets.NUGET}} |
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 @@ | ||
|
Validating CODEOWNERS rules …
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 @@ | ||
* @VisualBean |
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