Skip to content

Commit

Permalink
ci: release pipeline (#500)
Browse files Browse the repository at this point in the history
* Add experimental GitHub Action

* Add PR as trigger

* Add logging

* Add logging

* Disable release temporarily

* Add release trigger

* Rename v2 release pipeline

* Remoove automatic version bump

* Improve package performance, remove tag generation given created upon release

* Fix YAML file error

* Final version, add nuget push command
  • Loading branch information
Tr00d authored Sep 6, 2023
1 parent 8b1eb77 commit c91edb3
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
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

0 comments on commit c91edb3

Please sign in to comment.