Skip to content

Commit

Permalink
Update build.yml to upload artifacts per OS
Browse files Browse the repository at this point in the history
  • Loading branch information
PGZXB committed Jul 31, 2024
1 parent 6ecb3d3 commit 096200d
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions .github/workflows/build-and-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,28 +95,16 @@ jobs:
cp ${{ steps.strings.outputs.build-output-dir }}/imgui4cj_c_lib.dylib ${{ github.workspace }}/src/libs/libimgui4cj_c_lib.dylib
shell: bash

- name: Package files (Windows)
if: matrix.os == 'windows-latest'
run: |
New-Item -Path . -Name ${{ steps.strings.outputs.built-package-name }} -ItemType Directory
Copy-Item -Path cjpm.toml -Destination ${{ steps.strings.outputs.built-package-name }}\
Copy-Item -Path src -Destination ${{ steps.strings.outputs.built-package-name }}\ -Recurse
Compress-Archive -Path ${{ steps.strings.outputs.built-package-name }} -DestinationPath ${{ steps.strings.outputs.built-package-name }}.zip
shell: powershell

- name: Package files (Ubuntu, MacOS)
if: matrix.os != 'windows-latest'
- name: Package files
run: |
mkdir -p ${{ steps.strings.outputs.built-package-name }}
cp cjpm.toml ${{ steps.strings.outputs.built-package-name }}/
cp -r src ${{ steps.strings.outputs.built-package-name }}/
tar -czvf ${{ steps.strings.outputs.built-package-name }}.tar.gz ${{ steps.strings.outputs.built-package-name }}/
mkdir -p tmp_built/${{ steps.strings.outputs.built-package-name }}
cp cjpm.toml tmp_built/${{ steps.strings.outputs.built-package-name }}/
cp -r src tmp_built/${{ steps.strings.outputs.built-package-name }}/
shell: bash

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: build-artifact
name: ${{ steps.strings.outputs.built-package-name }}
path: |
${{ steps.strings.outputs.built-package-name }}.zip
${{ steps.strings.outputs.built-package-name }}.tar.gz
tmp_built

0 comments on commit 096200d

Please sign in to comment.