Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
################################################################################
### Build AsepriteDotNet (Release)
### Builds, tests, and packs the AsepriteDotNet source libraries.
### Once the build job finishes, the deploy job uploads the nupkg files to NuGet.
###
### - Can be triggered manually with workflow_dispatch
### - Allows specifying a branch (defaults to develop)
### - Version numbers are determined by the project properties on the branch
################################################################################
name: "Create Release"

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to build from (e.g., main, develop)'
required: true
type: string
default: 'develop'

jobs:
build:
name: "Build AsepriteDotNet"
runs-on: ubuntu-latest

steps:
- name: Clone Repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}

- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build AsepriteDotNet
run: dotnet build source/AsepriteDotNet/AsepriteDotNet.csproj --nologo --verbosity minimal --configuration Release

- name: Test AsepriteDotNet
run: dotnet test tests/AsepriteDotNet.Tests/AsepriteDotNet.Tests.csproj --nologo --verbosity minimal --configuration Release

- name: Pack AsepriteDotNet
run: dotnet pack source/AsepriteDotNet/AsepriteDotNet.csproj --nologo --verbosity minimal --configuration Release

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: ./.artifacts/src/**/*.nupkg

deploy:
name: "Deploy NuGets"
runs-on: ubuntu-latest
needs: [ build ]
permissions:
contents: write

steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: ./.artifacts

- name: Push Packages to NuGet
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
for PACKAGE in .artifacts/**/*.nupkg; do
dotnet nuget push "$PACKAGE" --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key "$NUGET_API_KEY"
done
62 changes: 0 additions & 62 deletions .github/workflows/main.yml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
################################################################################
### Pull Request Validation
### Runs unit tests on pull requests targeting the develop branch.
################################################################################
name: "Pull Request Validation"

on:
pull_request:
branches:
- develop

jobs:
test:
name: "Run Tests"
runs-on: ubuntu-latest

steps:
- name: Clone Repository
uses: actions/checkout@v4

- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Test AsepriteDotNet
run: dotnet test tests/AsepriteDotNet.Tests/AsepriteDotNet.Tests.csproj --nologo --verbosity minimal --configuration Release
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<NeutralLanguage>en</NeutralLanguage>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.9.0</Version>
<Version>1.9.1</Version>
</PropertyGroup>

<!-- Setup Code Analysis using the .editorconfig file -->
Expand Down
Loading