Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/JoeStrout/miniscript
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeStrout committed Feb 1, 2023
2 parents 532424a + 7e61f96 commit 9632741
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
25 changes: 14 additions & 11 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ on:
- "Build .NET project"
types:
- completed

permissions:
packages: write

jobs:
check_nuget:
name: Check if a new Nuget release is required
name: Check what kind of Nuget release is required
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
outputs:
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Get latest nuget package version
id: nuget-ver
run: |
export NUGET_VER=$(gh api -H "Accept: application/vnd.github+json" /users/JoeStrout/packages/nuget/Miniscript/versions | jq '.[0].name' | tr -d '"')
export NUGET_VER=$(gh api -H "Accept: application/vnd.github+json" /users/${{ github.repository_owner }}/packages/nuget/Miniscript/versions | jq '.[0].name' | tr -d '"')
echo "version=${NUGET_VER}" >> $GITHUB_OUTPUT
- name: Compare vs current version
Expand All @@ -48,24 +48,27 @@ jobs:
name: Release Nuget package
runs-on: ubuntu-latest
needs: check_nuget
if: ${{ github.event.workflow_run.conclusion == 'success' && needs.check_nuget.outputs.release == 'true' }}
if: ${{ github.event.workflow_run.conclusion == 'success' }}

defaults:
run:
working-directory: MiniScript-cs

steps:
- uses: actions/checkout@v3

- uses: actions/setup-dotnet@v2
with:
dotnet-version: 5.0.x

- name: Authenticate to Github Packages
run: dotnet nuget add source --username "${{ github.repository_owner }}" --password "${{ secrets.GITHUB_TOKEN }}" --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"

- name: Package
run: dotnet pack -c Release

run: |
[[ "${{ needs.check_nuget.outputs.release }}" == "true" ]] \
&& dotnet pack -c Release \
|| dotnet pack -c Release --version-suffix $(git rev-parse --short HEAD)
- name: Publish Nuget package
run: dotnet nuget push "bin/Release/Miniscript.*.nupkg" --source "github" --api-key "${{ secrets.GHPR_TOKEN }}"
2 changes: 1 addition & 1 deletion MiniScript-cs/Miniscript.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RootNamespace>Miniscript</RootNamespace>
<AssemblyName>Miniscript</AssemblyName>
<TargetFrameworks>net45;net5.0</TargetFrameworks>
<Version>1.5.1</Version>
<VersionPrefix>1.5.1</VersionPrefix>
<RepositoryUrl>https://github.com/JoeStrout/miniscript</RepositoryUrl>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
Expand Down

0 comments on commit 9632741

Please sign in to comment.