Skip to content

Commit

Permalink
fix: github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
derkalle4 committed Nov 7, 2024
1 parent e6726a8 commit e1bf4a4
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: repo_basename
run: echo "REPOSITORY_NAME=`basename ${{ github.repository }}`" >> $GITHUB_ENV

- name: Checkout repository
uses: actions/checkout@v2

- name: Set up .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x'

- name: Install dependencies
run: dotnet restore

- name: Get current version from ${{ env.REPOSITORY_FOLDER }}.cs
id: get_version
run: |
Expand All @@ -46,18 +41,28 @@ jobs:
echo "new_version=false" >> $GITHUB_ENV
fi
- name: Set up .NET
uses: actions/setup-dotnet@v2
if: env.new_version == 'true'
with:
dotnet-version: '8.0.x'

- name: Install dependencies
if: env.new_version == 'true'
run: dotnet restore

- name: Build project
if: env.new_version == 'true'
run: dotnet publish -c Release

- name: Rename release directory
if: env.new_version == 'true'
run: |
mv /home/runner/work/${{ github.repository }}/${{ github.repository }}/${{ env.REPOSITORY_FOLDER }}/bin/Release/net8.0/publish/ /home/runner/work/${{ github.repository }}/${{ github.repository }}/${{ env.REPOSITORY_FOLDER }}/bin/Release/net8.0/${{ env.REPOSITORY_FOLDER }}/
mv /home/runner/work/${{ env.REPOSITORY_NAME }}/${{ env.REPOSITORY_NAME }}/${{ env.REPOSITORY_FOLDER }}/bin/Release/net8.0/publish/ /home/runner/work/${{ github.repository }}/${{ github.repository }}/${{ env.REPOSITORY_FOLDER }}/bin/Release/net8.0/${{ env.REPOSITORY_FOLDER }}/
- name: Zip release
if: env.new_version == 'true'
run: cd /home/runner/work/${{ github.repository }}/${{ github.repository }}/${{ env.REPOSITORY_FOLDER }}/bin/Release/net8.0 && zip -r /home/runner/work/${{ github.repository }}-${{ env.version }}.zip ${{ env.REPOSITORY_FOLDER }}
run: cd /home/runner/work/${{ env.REPOSITORY_NAME }}/${{ env.REPOSITORY_NAME }}/${{ env.REPOSITORY_FOLDER }}/bin/Release/net8.0 && zip -r /home/runner/work/${{ github.repository }}-${{ env.version }}.zip ${{ env.REPOSITORY_FOLDER }}

- name: Get release notes
if: env.new_version == 'true'
Expand Down Expand Up @@ -88,4 +93,4 @@ jobs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/{{ env.REPOSITORY_NAME }}-${{ env.version }}.zip
asset_name: ${{ github.repository }}-${{ env.version }}.zip
asset_content_type: application/zip
asset_content_type: application/zip

0 comments on commit e1bf4a4

Please sign in to comment.