try publish npm and check if what happens if same tag tries to publis… #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish NuGet Package | |
on: | |
push: | |
branches: ['nightly', 'gh-action-test-branch'] # Only runs on pushes to the 'nightly' branch | |
workflow_dispatch: # Allows manual runs from the Actions tab | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Ensure all tags are fetched | |
- name: Install .NET SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.x.x' | |
- name: Extract Latest Tag as Version | |
id: get_version | |
run: echo "GIT_TAG_LATEST=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> "$GITHUB_ENV" | |
- name: Debug GIT_TAG_LATEST | |
run: echo "Version extracted; $GIT_TAG_LATEST" | |
- name: Restore Dependencies | |
run: dotnet restore src/Components/src/Components.fsproj | |
- name: Install NPM Dependencies | |
run: npm install | |
working-directory: src/Components | |
- name: Run Prebuild Script | |
run: npm run prebuild:net | |
working-directory: src/Components | |
- name: Build Project | |
run: dotnet build src/Components/src/Components.fsproj --configuration Release /p:GitTag=$GIT_TAG_LATEST | |
- name: Pack NuGet Package | |
run: dotnet pack src/Components/src/Components.fsproj --configuration Release --output nupkgs /p:GitTag=$GIT_TAG_LATEST | |
- name: Publish to NuGet | |
run: dotnet nuget push nupkgs/*.nupkg --api-key ${{ secrets.NUGET_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |