Skip to content

Commit

Permalink
Changes to the release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutomi committed Jul 7, 2024
1 parent a743e7e commit dc7edc1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* tsutomi
24 changes: 20 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ permissions:
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
type: string
description: 'The version to release'
required: true

jobs:
build:
Expand Down Expand Up @@ -36,21 +42,31 @@ jobs:
dotnet-version: 8.0.x

- name: Setup GitVersion
if: github.event.inputs.version == null
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'

- name: Determine Version
if: github.event.inputs.version == null
uses: gittools/actions/gitversion/[email protected]

- name: Emit Version Environment Variables from Input
if: github.event.inputs.version != null
run: |
echo "GitVersion_SemVer=${{ github.event.inputs.version }}" >> $GITHUB_ENV
echo "GitVersion_AssemblySemVer=${{ github.event.inputs.version }}" >> $GITHUB_ENV
echo "GitVersion_AssemblySemFileVer=${{ github.event.inputs.version }}.0" >> $GITHUB_ENV
echo "GitVersion_NuGetVersionV2=${{ github.event.inputs.version }}" >> $GITHUB_ENV
- name: Build
run: dotnet build -c Release /p:Version="${{ env.GitVersion_SemVer }}" /p:AssemblyVersion="${{ env.GitVersion_AssemblySemVer }}" /p:FileVersion="${{ env.GitVersion_AssemblySemFileVer }}"

- name: Pack the Nuget Packages
run: dotnet pack -c Release --no-build --no-restore --include-symbols --include-source --output nupkgs /p:PackageVersion="${{ env.GitVersion_NuGetVersionV2 }}"

# - name: Publish the Nuget Packages to the GitHub Package Registry
# run: dotnet nuget push **/*.nupkg --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/deveel/index.json"
- name: Publish the Nuget Packages to the GitHub Package Registry
run: dotnet nuget push **/*.nupkg --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/deveel/index.json"

# - name: Publish the Nuget Packages to the Nuget Gallery
# run: dotnet nuget push **/*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source "https://api.nuget.org/v3/index.json"
- name: Publish the Nuget Packages to the Nuget Gallery
run: dotnet nuget push **/*.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source "https://api.nuget.org/v3/index.json"

0 comments on commit dc7edc1

Please sign in to comment.