Skip to content

Automatic releases?

Automatic releases? #1

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: publish
on:
push:
branches:
- master # Run the workflow when pushing to the master branch
tags:
- v** # Only when a v... tag is pushed
# Sets permissions of the GITHUB_TOKEN to allow reading packages and push releases
permissions:
packages: read
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: true
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NuGetDirectory: ${{ github.workspace}}/nuget
defaults:
run:
shell: pwsh
jobs:
build:
uses: ./.github/workflows/build.yml

Check failure on line 28 in .github/workflows/publish.yml

View workflow run for this annotation

GitHub Actions / publish

Invalid workflow file

The workflow is not valid. In .github/workflows/publish.yml (Line: 28, Col: 11): Error from called workflow MonkeyModdingTroop/MonkeyLoader.ModTemplate/.github/workflows/build.yml@bd9d01da9ef3a119bd1c57c56c8482ed5043d69f (Line: 7, Col: 18): A sequence was not expected
release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [ build ]
steps:
- name: Download NuGet Packages Artifact
uses: actions/download-artifact@v4
with:
name: nuget
path: ${{ env.NuGetDirectory }}
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4
#env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
uses: mikepenz/action-gh-release@v1 #softprops/action-gh-release
with:
body: ${{steps.build_changelog.outputs.changelog}}
files: ${{ env.NuGetDirectory }}/*.nupkg
fail_on_unmatched_files: true
fail_on_asset_upload_issue: true
prerelease: ${{ contains(github.ref, '-') }} # simple check for vX.Y.Z-something
publish_github:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: [ build ]
steps:
- name: Download NuGet Packages Artifact
uses: actions/download-artifact@v4
with:
name: nuget
path: ${{ env.NuGetDirectory }}
- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
source-url: https://nuget.pkg.github.com/MonkeyModdingTroop/index.json
# Publish all NuGet packages to the GitHub feed
# Use --skip-duplicate to prevent errors if a package with the same version already exists.
# If you retry a failed workflow, already published packages will be skipped without error.
- name: Publish NuGet Packages
run: |
foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://nuget.pkg.github.com/MonkeyModdingTroop/index.json --skip-duplicate
}