Merge branch 'develop' #109
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
name: 'CI\CD' | |
on: | |
push: | |
branches: '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
tag: ${{ steps.setOutputs.outputs.tag }} | |
steps: | |
- name: Checkout source | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/[email protected] | |
with: | |
dotnet-version: '8.0.x' | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore -c Release | |
- name: Test | |
run: dotnet test --no-build -c Release --verbosity normal | |
- name: Upload artifacts | |
uses: actions/[email protected] | |
with: | |
name: kli.Localize.v${{ env.GitBuildVersionSimple }}.nupkg | |
path: src/kli.Localize.Generator/bin/Release/*.nupkg | |
- name: Set job outputs | |
id: setOutputs | |
run: echo "tag=v${{ env.GitBuildVersionSimple }}" >> $GITHUB_OUTPUT | |
deploy: | |
runs-on: ubuntu-latest | |
needs: [build] | |
if: ${{ github.ref == 'refs/heads/main' }} | |
steps: | |
- name: Download artifacts | |
uses: actions/[email protected] | |
with: | |
name: kli.Localize.${{ needs.build.outputs.tag }}.nupkg | |
path: artifacts | |
- name: Generate changelog | |
id: changelog | |
uses: jaywcjlove/changelog-generator@main | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "artifacts/*.nupkg" | |
body: | | |
${{ steps.changelog.outputs.changelog }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: "${{ needs.build.outputs.tag }}" | |
- name: Publish the package to nuget.org | |
run: dotnet nuget push artifacts/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }} |