Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: release pipeline #500

Merged
merged 12 commits into from
Sep 6, 2023
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Release
on:
release:
types: [ published ]

permissions:
actions: write
checks: write
contents: write
deployments: read
issues: write
discussions: write
packages: write
pages: write
pull-requests: write
security-events: write
statuses: write

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Define project file
uses: haya14busa/action-cond@v1
id: project_file
with:
cond: ${{ contains(github.event.release.target_commitish, 'release/video/') }}
if_true: "Vonage.Server.csproj"
if_false: "Vonage.csproj"
- name: Define project folder
uses: haya14busa/action-cond@v1
id: project_folder
with:
cond: ${{ contains(github.event.release.target_commitish, 'release/video/') }}
if_true: "Vonage.Server"
if_false: "Vonage"
- name: Parse version
uses: actions/github-script@v4
id: parse_version
with:
script: |
const version = ${{ github.event.release.tag_name }}.replace('v', '')
core.setOutput('no-version', version)
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.release.target_commitish }}
- name: Build
run: dotnet build -c Release ${{ steps.project_folder.outputs.value }}/${{ steps.project_file.outputs.value }} -v minimal
- name: Build Signed
run: dotnet build -c ReleaseSigned ${{ steps.project_folder.outputs.value }}/${{ steps.project_file.outputs.value }} -v minimal
- name: Pack
run: dotnet pack -c Release ${{ steps.project_folder.outputs.value }}/${{ steps.project_file.outputs.value }} -v minimal --no-build
- name: Pack Signed
run: dotnet pack -c ReleaseSigned ${{ steps.project_folder.outputs.value }}/${{ steps.project_file.outputs.value }} -v minimal --no-build
- name: NuGet Push
run: dotnet nuget push ${{ steps.project_folder.outputs.value }}/bin/Release/Vonage.${{ steps.parse_version.outputs.version }}.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
- name: NuGet Push Signed
run: dotnet nuget push ${{ steps.project_folder.outputs.value }}/bin/ReleaseSigned/Vonage.Signed.${{ steps.parse_version.outputs.version }}.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }}
1 change: 1 addition & 0 deletions Vonage.sln
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Workflows", "Workflows", "{
.github\workflows\mutation-testing.yml = .github\workflows\mutation-testing.yml
.github\workflows\multiframework-build.yml = .github\workflows\multiframework-build.yml
.github\workflows\net-build.yml = .github\workflows\net-build.yml
.github\workflows\release.yml = .github\workflows\release.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vonage.Server", "Vonage.Server\Vonage.Server.csproj", "{AC22C44D-AE7A-4FA1-8EA3-479578D6E3C6}"
Expand Down
Loading