fix(ci): upload artefacts #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Developer release | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
dev-build: | |
name: Develop build | |
# All architectures supported | |
strategy: | |
matrix: | |
arch: ['win-x64', 'win-arm64', 'linux-x64', 'linux-arm64', 'osx-x64', 'osx-arm64'] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.201 | |
- name: Build | |
shell: bash | |
# run: bash build-all.sh | |
run: | | |
version=$(cat src/GICutscenes.csproj | grep -oP "<Version>\K([0-9]\.[0-9]\.[0-9])") | |
release_name="GICutscenes-$version-${GITHUB_SHA::6}-${{ matrix.arch }}" | |
release_name_standalone="$release_name-standalone" | |
# Self contained | |
dotnet publish -c Release -r "${{ matrix.arch }}" -o "$release_name_standalone" --self-contained | |
# Framework dependant | |
dotnet publish -c Release -r "${{ matrix.arch }}" -o "$release_name" --self-contained false -p:PublishTrimmed=false | |
if [ "${{ matrix.arch }}" == "win-x64" ]; then | |
archive_type="zip" | |
# Pack for standalone version | |
7z a -tzip "${release_name_standalone}.zip" "./${release_name_standalone}/*" | |
# Pack for Framework dependant version | |
7z a -tzip "${release_name}.zip" "./${release_name}/*" | |
else | |
archive_type="tar.gz" | |
tar czvf "${release_name_standalone}.tar.gz" "$release_name_standalone" | |
tar czvf "${release_name}.tar.gz" "$release_name" | |
fi | |
rm -r "$release_name_standalone" | |
rm -r "$release_name" | |
echo "zip_standalone=${release_name_standalone}.${archive_type}" >> $GITHUB_ENV | |
echo "zip_native=${release_name}.${archive_type}" >> $GITHUB_ENV | |
- name: 'Upload standalone build' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.zip_standalone }} | |
path: ${{ env.zip_standalone }} | |
retention-days: 7 | |
- name: 'Upload native build' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.zip_native }} | |
path: ${{ env.zip_native }} | |
retention-days: 7 |