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
38 changes: 37 additions & 1 deletion .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout
Expand Down Expand Up @@ -42,7 +44,7 @@ jobs:
dotnet pack NetCord -c Release --no-build
dotnet pack NetCord.Services -c Release --no-build
dotnet pack Hosting/NetCord.Hosting -c Release --no-build
dotnet pack Hosting/NetCord.Hosting.Services -c Release --no-build
dotnet pack Hosting/NetCord.Hosting.Services -c Release --no-build
dotnet pack Hosting/NetCord.Hosting.AspNetCore -c Release --no-build

- name: Setup docs environment
Expand Down Expand Up @@ -81,6 +83,40 @@ jobs:
strip_components: 2
target: ~/NetCord/html

- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.ref_name }}
IS_PRERELEASE: ${{ contains(github.ref_name, '-') }}
run: |
Comment thread
KubaZ2 marked this conversation as resolved.
cp -r Documentation/_site "Documentation-$TAG"

zip -r "Documentation-$TAG.zip" "Documentation-$TAG"
tar -czvf "Documentation-$TAG.tar.gz" "Documentation-$TAG"

rm -r "Documentation-$TAG"

FILES=(
NetCord/bin/Release/*.*nupkg
NetCord.Services/bin/Release/*.*nupkg
Hosting/NetCord.Hosting/bin/Release/*.*nupkg
Hosting/NetCord.Hosting.Services/bin/Release/*.*nupkg
Hosting/NetCord.Hosting.AspNetCore/bin/Release/*.*nupkg
"Documentation-$TAG.zip"
"Documentation-$TAG.tar.gz"
)
Comment thread
KubaZ2 marked this conversation as resolved.

if gh release view "$TAG" >/dev/null 2>&1; then
gh release upload "$TAG" \
--clobber \
"${FILES[@]}"
else
gh release create "$TAG" \
--generate-notes \
--prerelease="$IS_PRERELEASE" \
"${FILES[@]}"
Comment thread
KubaZ2 marked this conversation as resolved.
fi

- name: Upload Build Artifacts
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
dotnet pack NetCord -c Release --no-build
dotnet pack NetCord.Services -c Release --no-build
dotnet pack Hosting/NetCord.Hosting -c Release --no-build
dotnet pack Hosting/NetCord.Hosting.Services -c Release --no-build
dotnet pack Hosting/NetCord.Hosting.Services -c Release --no-build
dotnet pack Hosting/NetCord.Hosting.AspNetCore -c Release --no-build

- name: Setup docs environment
Expand Down