Skip to content

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #5

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #5

Workflow file for this run

name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
release:
types: [ published ]
env:
app_name: RegexTestBench
publish_folder: publish
jobs:
build:
name: ${{ matrix.config.name }} | ${{ matrix.config.build_type }}
runs-on: ${{ matrix.config.os }}
strategy:
fail-fast: false
matrix:
config:
- {
name: Windows,
os: windows-latest,
project: Wpf,
runtime: win-x86,
framework: net5.0-windows,
is_single_file: "false",
build_type: Release
}
- {
name: Linux,
os: ubuntu-latest,
project: Gtk,
runtime: linux-x64,
framework: net5.0,
is_single_file: "true",
build_type: Release
}
- {
name: macOS,
os: macos-latest,
project: Mac,
runtime: osx-x64,
framework: net5.0,
is_single_file: "true",
build_type: Release
}
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core SDK
uses: actions/[email protected]
with:
dotnet-version: 5.0.x
# This cheap hack is needed because of a build environment "bug": https://github.com/actions/setup-dotnet/issues/155
- name: Clean
run: dotnet clean && dotnet nuget locals all --clear
- name: Publish
run: dotnet publish ${{ env.app_name }}/${{ env.app_name }}.${{ matrix.config.project }}/${{ env.app_name }}.${{ matrix.config.project }}.csproj
--configuration ${{ matrix.config.build_type }}
--output ${{ env.publish_folder }}
--self-contained true
-p:PublishSingleFile=${{ matrix.config.is_single_file }}
--runtime ${{ matrix.config.runtime }}
--framework ${{ matrix.config.framework }}
- name: Create Package
shell: bash
run: |
filename=${{ env.app_name }}-${{ matrix.config.runtime }}
if [[ "${{ runner.os }}" == 'Windows' ]]; then
7z a $filename.zip ./${{ env.publish_folder }}/*
else
zip --junk-paths $filename ./${{ env.publish_folder }}/*
fi
- uses: actions/upload-artifact@v2
with:
name: ${{ matrix.config.runtime }} ${{ matrix.config.build_type }}
path: ${{ env.app_name }}-${{ matrix.config.runtime }}.zip
- name: List Build Directory
if: always()
shell: bash
run: |
git status
ls -lR ${{ env.publish_folder }}
upload-packages:
needs: build
runs-on: ubuntu-latest
if: (github.event_name == 'release' && github.event.action == 'published' && startsWith(github.ref, 'refs/tags/'))
strategy:
fail-fast: false
matrix:
config:
- {
runtime: win-x86,
build_type: Release
}
- {
runtime: linux-x64,
build_type: Release
}
- {
runtime: osx-x64,
build_type: Release
}
steps:
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download artifacts
uses: actions/[email protected]
with:
name: ${{ matrix.config.runtime }} ${{ matrix.config.build_type }}
- name: Upload Release Assets
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ${{ env.app_name }}-${{ matrix.config.runtime }}.zip
asset_name: ${{ env.app_name }}-${{ matrix.config.runtime }}.zip
asset_content_type: application/zip