Skip to content

Modify PackAndPushAfterMerge workflow for NuGet push #9

Modify PackAndPushAfterMerge workflow for NuGet push

Modify PackAndPushAfterMerge workflow for NuGet push #9

name: PackAndPushAfterMerge
on:
push:
branches:
- master
jobs:
build:
name: ReleaseTheTask
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Get version number
id: vars
shell: pwsh
run: |
$version = ([xml]($tmp = Get-Content -Path 'Frends.Community.SQL/Frends.Community.SQL.csproj')).SelectSingleNode("Project/PropertyGroup/Version").InnerText
echo "::set-output name=version_number::$version"
- name: Pack release version of task
run: dotnet pack --configuration Release --include-source
- name: Get package name
id: package_name
run: |
$pkg = Get-ChildItem -Path . -Filter *.nupkg -Exclude *.symbols.nupkg -Recurse | Select-Object -First 1
echo "full_name=$($pkg.FullName)" >> $env:GITHUB_OUTPUT
echo "base_name=$($pkg.BaseName)" >> $env:GITHUB_OUTPUT
- name: Push to Frends Community Main Feed
shell: bash
run: |
curl -X POST "https://frends-fsp-cloudprod-agent.frendsapp.com/api/community-tasks/v1/push?feed_type=main" \
-H "x-api-key: ${{ secrets.FRENDS_COMMUNITY_TASKS_API_KEY }}" \
-H "Content-Type: application/octet-stream" \
--data-binary @"${{ steps.package_name.outputs.full_name }}"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.vars.outputs.version_number }}
release_name: Release ${{ steps.vars.outputs.version_number }}
body: |
You can install the task via frends UI Task View or you can find the NuGet at https://feeds.dev.azure.com/frends-platform/frends-tasks/_apis/packaging/Feeds/community-main/packages
draft: false
prerelease: false