Skip to content

Commit

Permalink
Bump to .NET 8, add release CI
Browse files Browse the repository at this point in the history
  • Loading branch information
MSWS committed Jan 24, 2024
1 parent a8c9aab commit 383848c
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
70 changes: 70 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: .NET Build and Release

on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev

jobs:
build:
runs-on: ubuntu-latest

container:
image: mcr.microsoft.com/dotnet/nightly/sdk:7.0

steps:
- uses: actions/checkout@v3

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build src/Jailbreak/Jailbreak.csproj --no-restore
- name: Publish
run: dotnet publish src/Jailbreak/Jailbreak.csproj --no-build --no-restore

- name: Archive production artifacts
uses: actions/[email protected]
with:
name: net7.0-artifacts
path: build
if-no-files-found: error

release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: net7.0-artifacts
path: build

- name: Create Tag
id: tag_version
run: |
DATE=$(date +'%y.%m.%d-%H%M%S')
echo "RELEASE_TAG=$DATE" >> $GITHUB_ENV
- name: Determine if Pre-release
id: prerelease
run: |
if [ "${{ github.ref }}" != "refs/heads/main" ]; then
echo "IS_PRERELEASE=true" >> $GITHUB_ENV
else
echo "IS_PRERELEASE=false" >> $GITHUB_ENV
fi
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.RELEASE_TAG }}
files: bin/Debug/net7.0/*
prerelease: ${{ env.IS_PRERELEASE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.0",
"version": "8.0.0",
"rollForward": "latestMinor",
"allowPrerelease": false
}
Expand Down

0 comments on commit 383848c

Please sign in to comment.