Skip to content

Commit

Permalink
try to deploy in two steps
Browse files Browse the repository at this point in the history
  • Loading branch information
thefakeplace committed Dec 27, 2023
1 parent 7e1de30 commit f65bc5e
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ env:
CACHE_SUFFIX: c # cache busting

jobs:
deploy:
name: Deploy ${{ matrix.name }}
build:
name: Build ${{ matrix.name }}
permissions: write-all
strategy:
fail-fast: false
Expand All @@ -23,6 +23,7 @@ jobs:
- name: Windows x86_64
os: windows-2022
target: x86_64-pc-windows-msvc
bin_suffix: ".exe"
# macOS
- name: macOS x86_64
os: macos-latest
Expand All @@ -41,18 +42,26 @@ jobs:
- name: Compile
shell: bash
run: |
echo build path: ${{ matrix.target }}/release/${{ env.GAME_NAME }}${{ matrix.bin_suffix }}
cargo build --target ${{ matrix.target }} --release --no-default-features
- name: Release
- name: Create artifact
uses: actions/upload-artifact@v2
with:
name: ${{ env.GAME_NAME }}-${{ matrix.platform.os_name }}
path: ${{ matrix.target }}/release/${{ env.GAME_NAME }}${{ matrix.bin_suffix }}

release:
name: Create release
needs: build
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Create release
shell: bash
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
mv target/${{ matrix.target }}/release/${{ env.GAME_NAME }} ${{ env.GAME_NAME }}-${{ matrix.target }}
gh release create ${{ github.ref_name }} ${{ env.GAME_NAME }}-${{ matrix.target }} --title ${{ github.ref_name }}
elif [ "$RUNNER_OS" == "Windows" ]; then
mv target/${{ matrix.target }}/release/${{ env.GAME_NAME }}.exe ${{ env.GAME_NAME }}-${{ matrix.target }}.exe
gh release create ${{ github.ref_name }} ${{ env.GAME_NAME }}-${{ matrix.target }}.exe --title ${{ github.ref_name }}
else
echo "unsupported runner os: $RUNNER_OS"
exit 1
fi
echo "creating release with files:"
ls -R
gh release create ${{ github.ref_name }} $(ls)

0 comments on commit f65bc5e

Please sign in to comment.