feat: Update to use release please #1
This file contains hidden or 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
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
packages: write | |
outputs: | |
release_created: ${{ steps.release.outputs.release_created }} | |
tag_name: ${{ steps.release.outputs.tag_name }} | |
steps: | |
- name: Release | |
id: release | |
uses: googleapis/release-please-action@v4 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
release-type: simple | |
config-file: release-please-config.json | |
manifest-file: .release-please-manifest.json | |
publish: | |
name: Publish | |
needs: release-please | |
if: ${{ needs.release-please.outputs.release_created }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: | | |
9.0.x | |
- name: Cache NuGet Packages | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
restore-keys: | | |
${{ runner.os }}-nuget | |
- name: Build | |
run: dotnet build -c Release | |
- name: Pack | |
run: dotnet pack -c Release --output nupkgs --no-build ./src/TailwindBuild/TailwindBuild.csproj | |
- name: Push Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: latest | |
path: ./nupkgs/*.nupkg | |
push-guthub: | |
name: Push GitHub Nuget | |
needs: publish | |
permissions: | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: latest | |
- name: Dotnet NuGet Add Source | |
run: dotnet nuget add source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" --name github --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text | |
- name: Dotnet NuGet Push | |
run: dotnet nuget push *.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source github --skip-duplicate |