Skip to content

Commit

Permalink
Fix release creation to include assets (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
geofflamrock authored Nov 6, 2024
1 parent 5758fd4 commit f920d59
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions .github/workflows/build-and-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
- name: macOS
os: macos-latest
runtime-id: osx-x64
artifact-name: osx-x64
artifact-name: macos-x64

name: Build and test on ${{ matrix.name }}

Expand All @@ -85,7 +85,7 @@ jobs:
run: dotnet test --no-build -c Release --verbosity normal

- name: Publish
run: dotnet publish Stack/Stack.csproj -c Release -r ${{ matrix.runtime-id }} -p:Version=${{ needs.version.outputs.version }} -o ${{ github.workspace }}/publish
run: dotnet publish Stack/Stack.csproj -c Release -r ${{ matrix.runtime-id }} -p:Version=${{ needs.version.outputs.version }} -p:DebugType=None -p:DebugSymbols=false -o ${{ github.workspace }}/publish

- name: Upload artifact
uses: actions/upload-artifact@v4
Expand All @@ -95,18 +95,44 @@ jobs:
path: ${{ github.workspace }}/publish

publish:
name: Publish release version
name: Publish
needs: [version, build]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
permissions:
contents: write

steps:
- name: Download artifact
- name: Download linux artifact
uses: actions/download-artifact@v4
with:
path: ${{ github.workspace }}/publish
name: linux-x64
path: ${{ github.workspace }}/artifacts/linux-x64

- name: Download windows artifact
uses: actions/download-artifact@v4
with:
name: windows-x64
path: ${{ github.workspace }}/artifacts/windows-x64

- name: Download macOS artifact
uses: actions/download-artifact@v4
with:
name: macos-x64
path: ${{ github.workspace }}/artifacts/macos-x64

- run: mkdir -p ${{ github.workspace }}/publish

- name: Zip linux artifact
run: zip -r ${{ github.workspace }}/publish/linux-x64.zip ${{ github.workspace }}/artifacts/linux-x64

- name: Zip windows artifact
run: zip -r ${{ github.workspace }}/publish/windows-x64.zip ${{ github.workspace }}/artifacts/windows-x64

- name: Zip macOS artifact
run: zip -r ${{ github.workspace }}/publish/macos-x64.zip ${{ github.workspace }}/artifacts/macos-x64

- name: List published artifacts
run: ls -R ${{ github.workspace }}/publish

- name: Create tag
uses: actions/[email protected]
Expand All @@ -118,6 +144,7 @@ jobs:
ref: 'refs/tags/v${{ needs.version.outputs.version }}',
sha: context.sha
})
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

- name: Create release
id: create_release
Expand All @@ -127,3 +154,4 @@ jobs:
draft: false
prerelease: false
files: ${{ github.workspace }}/publish/*
if: github.event_name == 'push' && github.ref == 'refs/heads/main'

0 comments on commit f920d59

Please sign in to comment.