-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update pipelines to add versionize
- Loading branch information
1 parent
517f04b
commit 0ec3a20
Showing
7 changed files
with
142 additions
and
27 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,48 @@ | ||
name: Bump Version common workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
WORKING_DIRECTORY: | ||
required: true | ||
type: string | ||
PROJECT_NAME_COMMIT_SUFFIX: | ||
required: true | ||
type: string | ||
outputs: | ||
OUTCOME: | ||
description: "Outcome of the versionize action, 'success' if a new version was published" | ||
value: ${{ jobs.publish-new-version.outputs.OUTCOME }} | ||
|
||
jobs: | ||
publish-new-version: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ${{ inputs.WORKING_DIRECTORY }} | ||
outputs: | ||
OUTCOME: ${{ steps.versionize.outcome }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: '0' | ||
- name: Install Versionize | ||
run: dotnet tool install --global Versionize | ||
- name: Setup git | ||
run: | | ||
git config --local user.email "zupitdevs@users.noreply.github.com" | ||
git config --local user.name "ZupitDevs" | ||
- name: Versionize Release | ||
id: versionize | ||
run: versionize --changelog-all --exit-insignificant-commits --proj-version-bump-logic --skip-tag --commit-suffix "[${{ inputs.PROJECT_NAME_COMMIT_SUFFIX }}]" | ||
continue-on-error: true | ||
- name: No release required | ||
if: steps.versionize.outcome != 'success' | ||
run: echo "Skipping publishing. No release required." | ||
- name: Push changes to GitHub | ||
if: steps.versionize.outcome == 'success' | ||
uses: ad-m/github-push-action@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ github.ref }} | ||
tags: 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
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 @@ | ||
name: Release to nuget | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
WORKING_DIRECTORY: | ||
required: true | ||
type: string | ||
PROJECT: | ||
required: true | ||
type: string | ||
DOTNET_IMAGE: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ inputs.DOTNET_IMAGE }} | ||
defaults: | ||
run: | ||
working-directory: ${{ inputs.WORKING_DIRECTORY }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create NuGet package | ||
run: dotnet pack -c Release -o ./artifacts/${{ inputs.PROJECT }} ${{ inputs.PROJECT }} | ||
|
||
# - name: Publish NuGet package | ||
# run: dotnet nuget push ./artifacts/${{ inputs.PROJECT }}/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.ZUPIT_NUGET_TOKEN }} | ||
|
||
- name: Publish NuGet package test | ||
run: echo "Publish to 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
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,27 @@ | ||
name: Test common workflow | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
WORKING_DIRECTORY: | ||
required: true | ||
type: string | ||
DOTNET_IMAGE: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ${{ inputs.DOTNET_IMAGE }} | ||
defaults: | ||
run: | ||
working-directory: ${{ inputs.WORKING_DIRECTORY }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run tests | ||
run: dotnet test |
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