Skip to content

Merge pull request #2558 from planetarium/v200130-170-latest-data-update #524

Merge pull request #2558 from planetarium/v200130-170-latest-data-update

Merge pull request #2558 from planetarium/v200130-170-latest-data-update #524

Workflow file for this run

name: publish
on:
push:
branches:
- development
- main
tags:
- "*.*.*"
jobs:
nuget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.400
- name: build
run: |
dotnet_args="-c Release -p:NoPackageAnalysis=true"
if [[ ! "$GITHUB_REF" =~ ^refs/tags/* ]]; then
project_suffix=dev.${{ github.sha }}
dotnet_args="$dotnet_args --version-suffix $project_suffix"
fi
# shellcheck disable=SC2086
dotnet build $dotnet_args
# shellcheck disable=SC2086
dotnet pack $dotnet_args
- name: push
if: github.event_name != 'pull_request'
run: |
if [[ "$NUGET_API_KEY" != "" ]]; then
for project in Lib9c Lib9c.Abstractions
do
dotnet nuget push ./$project/.bin/Lib9c.*.nupkg \
--api-key "$NUGET_API_KEY" \
--skip-duplicate \
--source https://api.nuget.org/v3/index.json
done
fi
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
jsr:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: 8
run_install: true
- run: pnpm -r build
- name: choose version
working-directory: "@planetarium/lib9c"
run: |
if [[ ! "$GITHUB_REF" =~ ^refs/tags/[0-9]+.[0-9]+.[0-9]+$ ]]; then
suffix="-dev+${{ github.sha }}"
jq ".version = .version + \"$suffix\"" jsr.json > jsr.json.tmp
mv jsr.json.tmp jsr.json
fi
- run: npx jsr publish --allow-dirty
working-directory: "@planetarium/lib9c"