Skip to content

Commit

Permalink
update workflow, remove docker image and package to github nuget
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed Dec 18, 2023
1 parent ccf1b2b commit c3e889f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 61 deletions.
81 changes: 28 additions & 53 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ on:
release:
types: [ published ]

permissions:
contents: write

env:
build-output: sakura-publish

Expand All @@ -19,7 +16,7 @@ jobs:
url: https://dragonfruit.network/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -33,59 +30,33 @@ jobs:
ignore_missing: true
version: ${{ github.ref_name }}

linux-container:
website-package:
runs-on: ubuntu-latest

needs:
- sentry-release

environment:
name: production
url: https://dragonfruit.network/

permissions:
packages: write

steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Create build output folder
run: mkdir ${{ env.build-output }}

- name: Restore NuGet Packages
run: dotnet restore

- name: Build Project
run: dotnet publish -c Release -o ${{ env.build-output }} -p:Version=${{ github.ref_name }} DragonFruit.Sakura.Host/DragonFruit.Sakura.Host.csproj

- id: meta
name: Create metadata
uses: docker/metadata-action@v4
with:
images: dragonfruitdotnet/website
tags: |
type=raw,value=latest
type=ref,event=tag
- name: Dockerise
uses: docker/build-push-action@v3
with:
push: true
context: ${{ env.build-output }}
platforms: linux/arm64,linux/amd64
tags: ${{ steps.meta.outputs.tags }}
file: DragonFruit.Sakura.Host/Dockerfile
dotnet-version: '8.0.x'

- name: Build Program
run: dotnet publish -c Release -p:Version=${{ github.event.release.tag_name }} DragonFruit.Sakura

- name: Package Output
run: dotnet pack -c Release -p:Version=${{ github.event.inputs.version }} -o ./packages --no-build DragonFruit.Sakura

- name: Upload Package
run: dotnet nuget push -s https://nuget.pkg.github.com/dragonfruitnetwork/index.json -k ${{ github.token }} ./packages/*.nupkg

windows-iis:
runs-on: windows-latest

permissions:
contents: write

needs:
- sentry-release

Expand All @@ -94,14 +65,18 @@ jobs:
url: https://dragonfruit.network/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Build Program
run: dotnet publish -c Release -p:Version=${{ github.ref_name }} -p:PublishProfile=Web.pubxml DragonFruit.Sakura.Host
run: dotnet publish -c Release -p:Version=${{ github.event.release.tag_name }} -p:PublishProfile=Web.pubxml DragonFruit.Sakura.Host

- name: Archive Output
run: Compress-Archive -Path .\DragonFruit.Sakura.Host\bin\publish\* -DestinationPath Sakura-${{ github.ref_name }}.zip
run: Compress-Archive -Path .\DragonFruit.Sakura.Host\bin\publish\* -DestinationPath Sakura-${{ github.event.release.tag_name }}.zip

- name: Upload Deploy Package
uses: softprops/action-gh-release@v1
with:
files: Sakura-${{ github.ref_name }}.zip
files: Sakura-${{ github.event.release.tag_name }}.zip
8 changes: 0 additions & 8 deletions DragonFruit.Sakura.Host/Dockerfile

This file was deleted.

7 changes: 7 additions & 0 deletions DragonFruit.Sakura/DragonFruit.Sakura.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
<IsPackable>true</IsPackable>
</PropertyGroup>

<PropertyGroup>
<Title>DragonFruit Sakura</Title>
<Authors>DragonFruit Network</Authors>
<Copyright>Copyright (c) DragonFruit Network</Copyright>
<Description>The face of DragonFruit Network</Description>
</PropertyGroup>

<PropertyGroup>
<PackageIcon>icon.png</PackageIcon>
<PackageId>DragonFruit.Sakura</PackageId>
Expand Down

0 comments on commit c3e889f

Please sign in to comment.