Fix creating tag #35
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: "Build nuget package" | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- 'README.MD' | |
- 'LICENSE' | |
jobs: | |
BuildTestAndPush: | |
name: "Build test and push" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Setup .NET Core SDK | |
uses: actions/setup-dotnet@v4.1.0 | |
with: | |
dotnet-version: 9.x | |
- name: Use CLI | |
uses: scaleway/action-scw@v0 | |
with: | |
save-config: true | |
export-config: true | |
version: v2.30.0 | |
access-key: ${{ secrets.SCW_ACCESS_KEY }} | |
secret-key: ${{ secrets.SCW_SECRET_KEY }} | |
default-project-id: ${{ secrets.SCW_DEFAULT_PROJECT_ID }} | |
default-organization-id: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }} | |
- name: "Output config info as json" | |
run: scw config info --output json | |
- name: "Restore" | |
run: dotnet restore ./src/LodeKennes.Extensions.Scaleway.SecretManager/ | |
- name: "Build" | |
run: dotnet build --no-restore -c Release ./src/LodeKennes.Extensions.Scaleway.SecretManager/ | |
- name: "Run tests" | |
run: dotnet test -c Release ./test/LodeKennes.Extensions.Scaleway.Tests/ | |
- name: "Create nuget package" | |
run: dotnet pack -o ./nuget-package -c Release ./src/LodeKennes.Extensions.Scaleway.SecretManager/ | |
- name: Extract version | |
id: vars | |
run: echo "##[set-output name=VERSION;]$(grep '<Version>' src/LodeKennes.Extensions.Scaleway.SecretManager/LodeKennes.Extensions.Scaleway.SecretManager.csproj | sed -E 's/.*<Version>(.*)<\/Version>.*/\1/')" | |
- name: Set Git user | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "actions@github.com" | |
- name: Bump version and push tag | |
id: tag_version | |
uses: mathieudutour/github-tag-action@v6.2 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
custom_tag: ${{ steps.vars.outputs.VERSION }} | |
- name: Create GitHub Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ steps.vars.outputs.VERSION }} | |
release_name: Release v${{ steps.vars.outputs.VERSION }} | |
draft: false | |
prerelease: false | |
- name: "Publish package" | |
run: dotnet nuget push ./nuget-package/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json |