diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml index 3214f625..7a5fc62d 100644 --- a/.github/workflows/dotnet-build.yml +++ b/.github/workflows/dotnet-build.yml @@ -5,11 +5,6 @@ name: build on: workflow_call: - inputs: - version: - type: string - description: 'Libation version' - required: true env: DOTNET_VERSION: '7' # The .NET SDK version to use @@ -28,9 +23,6 @@ jobs: ui: WinForms release_name: classic steps: - - name: Lowercase os - run: | - echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} - uses: actions/checkout@v3 - name: Setup .NET uses: actions/setup-dotnet@v3 @@ -45,14 +37,9 @@ jobs: dotnet publish -c ${{ env.DOTNET_CONFIGURATION }} -o bin\Publish\${{ matrix.os }}-${{ matrix.release_name }} LoadByOS\${{ matrix.os }}ConfigApp\${{ matrix.os }}ConfigApp.csproj -p:PublishProfile=LoadByOS\${{ matrix.os }}ConfigApp\PublishProfiles\${{ matrix.os }}Profile.pubxml dotnet publish -c ${{ env.DOTNET_CONFIGURATION }} -o bin\Publish\${{ matrix.os }}-${{ matrix.release_name }} LibationCli\LibationCli.csproj -p:PublishProfile=LibationCli\Properties\PublishProfiles\${{ matrix.os }}Profile.pubxml dotnet publish -c ${{ env.DOTNET_CONFIGURATION }} -o bin\Publish\${{ matrix.os }}-${{ matrix.release_name }} Hangover${{ matrix.ui }}\Hangover${{ matrix.ui }}.csproj -p:PublishProfile=Hangover${{ matrix.ui }}\Properties\PublishProfiles\${{ matrix.os }}Profile.pubxml - - name: Rename release folder - working-directory: ./Source - run: ren ./bin/Publish/${{ matrix.os }}-${{ matrix.release_name }} Libation.${{ inputs.version }}-${{ matrix.os }}-${{ matrix.release_name }} - - name: Zip artifact - run: Compress-Archive ./Source/bin/Publish/Libation.${{ inputs.version }}-${{ matrix.os }}-${{ matrix.release_name }} Libation.${{ inputs.version }}-${{ matrix.os }}-${{ matrix.release_name }}.zip - name: Publish artifact uses: actions/upload-artifact@v3 with: - name: Libation.${{ inputs.version }}-${{ matrix.os }}-${{ matrix.release_name }} - path: Libation.${{ inputs.version }}-${{ matrix.os }}-${{ matrix.release_name }}.zip + name: ${{ matrix.os }}-${{ matrix.release_name }} + path: ./Source/bin/Publish/${{ matrix.os }}-${{ matrix.release_name }}/* if-no-files-found: error \ No newline at end of file diff --git a/.github/workflows/dotnet-publish.yml b/.github/workflows/dotnet-publish.yml index 09414e93..de307eb1 100644 --- a/.github/workflows/dotnet-publish.yml +++ b/.github/workflows/dotnet-publish.yml @@ -16,17 +16,34 @@ env: jobs: build: uses: ./.github/workflows/dotnet-build.yml - with: - version: ${{ github.ref_name }} - publish: + release: needs: build runs-on: ubuntu-latest steps: - - name: Download artifact + - name: Calculate version + id: version + run: | + export TAG=${{ github.ref_name }} + echo "version=${TAG#v}" >> $GITHUB_OUTPUT + + - name: Download artifacts uses: actions/download-artifact@v3 with: path: artifacts + + - name: Rename artifacts + id: rename + working-directory: ./artifacts + run: for FILENAME in *; do mv ${FILENAME} Libation.${{ steps.version.outputs.version }}-${FILENAME,,}; done + + - name: Zip assets + working-directory: ./artifacts + run: | + for FILENAME in *; do zip -r ${FILENAME}.zip ${FILENAME}; done + mkdir ./assets + mv *.zip ./assets + - name: Create release id: create_release uses: actions/create-release@v1 @@ -34,15 +51,15 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token with: tag_name: ${{ github.ref }} - release_name: Libation ${{ github.ref }} + release_name: Libation ${{ steps.version.outputs.version }} body: draft: true prerelease: false - - name: Upload Release Assets - id: upload-release-assets + + - name: Upload release assets uses: dwenegar/upload-release-assets@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: release_id: ${{ steps.create_release.outputs.id }} - assets_path: ./artifacts \ No newline at end of file + assets_path: ./artifacts/assets \ No newline at end of file diff --git a/.github/workflows/dotnet-validate.yml b/.github/workflows/dotnet-validate.yml index 9b32845f..fa1ef57d 100644 --- a/.github/workflows/dotnet-validate.yml +++ b/.github/workflows/dotnet-validate.yml @@ -16,6 +16,4 @@ env: jobs: build: - uses: ./.github/workflows/dotnet-build.yml - with: - version: ${{ github.sha }} \ No newline at end of file + uses: ./.github/workflows/dotnet-build.yml \ No newline at end of file diff --git a/.releaseindex.json b/.releaseindex.json index c9b05167..4b0f776a 100644 --- a/.releaseindex.json +++ b/.releaseindex.json @@ -1,6 +1,6 @@ { - "WindowsClassic": "Libation\\.v\\d+\\.\\d+\\.\\d+-Windows-chardonnay\\.zip", - "WindowsAvalonia":"Libation\\.v\\d+\\.\\d+\\.\\d+-Windows-chardonnay\\.zip", - "LinuxAvalonia": "Libation\\.v\\d+\\.\\d+\\.\\d+-Linux-chardonnay", - "MacOSAvalonia": "Libation\\.v\\d+\\.\\d+\\.\\d+-MacOS-chardonnay" + "WindowsClassic": "Libation\\.\\d+\\.\\d+\\.\\d+-Windows-classic\\.zip", + "WindowsAvalonia":"Libation\\.\\d+\\.\\d+\\.\\d+-Windows-chardonnay\\.zip", + "LinuxAvalonia": "Libation\\.\\d+\\.\\d+\\.\\d+-Linux-chardonnay", + "MacOSAvalonia": "Libation\\.\\d+\\.\\d+\\.\\d+-MacOS-chardonnay" }