Skip to content

Publish ShopifySharp 6.20.0 #72

Publish ShopifySharp 6.20.0

Publish ShopifySharp 6.20.0 #72

Workflow file for this run

name: Release Pipeline
run-name: Publish ${{ inputs.package_id }} ${{ inputs.package_version }}
on:
workflow_dispatch:
inputs:
package_id:
description: "Package"
type: choice
default: 'ShopifySharp'
options:
- 'ShopifySharp'
- 'ShopifySharp.Extensions.DependencyInjection'
package_version:
description: "New package version"
type: string
required: true
jobs:
publish:
name: "Publish release packages"
runs-on: ubuntu-latest
environment: "Release deployment environment"
steps:
- name: Install fish
run: |
sudo apt-add-repository ppa:fish-shell/release-3 \
&& sudo apt-get -qq update \
&& sudo apt-get -qq install fish parallel
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
- name: Install dotnet tools
run: |
dotnet tool install -g dotnet-setversion
- name: Clone repository
uses: actions/checkout@v4
- name: Bump package version
run: setversion -p "${{ inputs.package_version }}" "${{inputs.package_id }}/${{ inputs.package_id }}.csproj"
- name: Build and pack
run: fish .github/scripts/build.fish
shell: bash
env:
GITHUB_RUN_NUMBER: "${{ github.run_number }}"
ARTIFACT_DIR: "./artifacts"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: artifacts
if-no-files-found: error
path: |
./artifacts/ShopifySharp.${{ inputs.package_version }}.nupkg
./artifacts/ShopifySharp.${{ inputs.package_version }}.snupkg
./artifacts/ShopifySharp.Extensions.DependencyInjection.${{ inputs.package_version }}.nupkg
./artifacts/ShopifySharp.Extensions.DependencyInjection.${{ inputs.package_version }}.snupkg
- name: Commit package version change
uses: EndBug/add-and-commit@v9
with:
add: "${{ inputs.package_id }}/${{ inputs.package_id }}.csproj"
commit: --signoff
message: "Bump version to ${{ inputs.package_version }}"
pathspec_error_handling: exitAtEnd
default_author: github_actions
push: true
- name: Publish ${{ inputs.package_id }} package to Nuget
run: dotnet nuget push --skip-duplicate -k ${{ secrets.NUGET_TOKEN }} -s "https://api.nuget.org/v3/index.json" ./artifacts/${{ inputs.package_id }}.${{ inputs.package_version }}.nupkg
- name: Create Github release for ${{ inputs.package_id }}
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ inputs.package_id }}/${{ inputs.package_version }}"
prerelease: false
draft: true
title: "${{ inputs.package_id }} ${{ inputs.package_version }}"
files: |
./artifacts/${{ inputs.package_id }}.${{ inputs.package_version }}.nupkg
./artifacts/${{ inputs.package_id }}.${{ inputs.package_version }}.snupkg