Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
matigramirez committed Oct 9, 2023
1 parent f1a5615 commit 903a468
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/dotnet.yml → .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: .NET
name: build and test

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: release

on:
push:
tags:
- "v*"

jobs:
nuget:
name: Publish NuGet package
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
source-url: https://nuget.pkg.github.com/matigramirez/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build and generate NuGet package
run: dotnet pack ./src/Parsec -c Release -o publish

- name: Publish NuGet package
run: dotnet nuget push ./publish/*.nupkg --skip-duplicate --no-symbols true
24 changes: 1 addition & 23 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create release and publish nuget package
name: release

on:
push:
Expand All @@ -23,25 +23,3 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}

nuget:
name: Publish NuGet package
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
source-url: https://nuget.pkg.github.com/matigramirez/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build and generate NuGet package
run: dotnet pack ./src/Parsec -c Release -o publish

- name: Publish NuGet package
run: dotnet nuget push ./publish/*.nupkg --skip-duplicate --no-symbols true
4 changes: 3 additions & 1 deletion Parsec.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ ProjectSection(SolutionItems) = preProject
LICENSE = LICENSE
README.md = README.md
.editorconfig = .editorconfig
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
.github\workflows\build.yml = .github\workflows\build.yml
.github\workflows\nuget.yml = .github\workflows\nuget.yml
.github\workflows\release.yml = .github\workflows\release.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5BFF8B78-2976-44BE-B2BF-B954ABFF7FE2}"
Expand Down

0 comments on commit 903a468

Please sign in to comment.