Bump actions/download-artifact from 2 to 4.1.7 in /.github/workflows #46
This file contains hidden or 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: Build MSVC project | |
on: [ push, pull_request ] # yamllint disable-line rule:truthy | |
jobs: | |
check-formatting: | |
name: Check Code Formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check Markdown syntax (docker) | |
shell: sh | |
run: make -- check-md | |
- name: Check YAML syntax (docker) | |
shell: sh | |
run: make -- check-yaml | |
build: | |
name: Visual Studio 2019 | |
runs-on: windows-2019 | |
env: | |
ARTIFACT_NAME: logreader-${{ matrix.config.config }}-${{ matrix.config.platform }}.7z | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- config: Release | |
platform: x64 | |
output_dir: Release-x64 | |
- config: Release | |
platform: x86 | |
output_dir: Release-Win32 | |
- config: Debug | |
platform: x64 | |
output_dir: Debug-x64 | |
- config: Debug | |
platform: x86 | |
output_dir: Debug-Win32 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Add msbuild to PATH | |
uses: microsoft/[email protected] | |
with: | |
msbuild-architecture: ${{ matrix.config.platform }} | |
- name: Build MSVC project - ${{ matrix.config.config }} - ${{ matrix.config.platform }} | |
env: | |
CONFIG: ${{ matrix.config.config }} | |
PLATFORM: ${{ matrix.config.platform }} | |
shell: sh | |
run: | | |
MSBuild.exe ./LogReader.sln "/property:Configuration=$CONFIG" "/property:Platform=$PLATFORM" | |
- name: Run Unit Tests - ${{ matrix.config.config }} - ${{ matrix.config.platform }} | |
shell: sh | |
run: ./${{ matrix.config.output_dir }}/tests.exe | |
- name: Copy Executable | |
shell: sh | |
run: | | |
mkdir -p -- "$RUNNER_TEMP/instdir" | |
cp -- ./${{ matrix.config.output_dir }}/LogReader.exe "$RUNNER_TEMP/instdir" | |
- name: Pack Build Artifact | |
working-directory: ${{ runner.temp }}/instdir | |
shell: sh | |
run: cmake -E tar vcf "$RUNNER_TEMP/$ARTIFACT_NAME" --format=7zip -- . | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
path: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }} | |
name: ${{ env.ARTIFACT_NAME }} | |
create-release: | |
name: Create Release for ${{ github.ref }} | |
if: contains(github.ref, 'tags/v') | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- check-formatting | |
permissions: | |
contents: write | |
env: | |
ARTIFACT_NAME1: logreader-Release-x86.7z | |
ARTIFACT_NAME2: logreader-Release-x64.7z | |
steps: | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Download Artifact x86 | |
uses: actions/[email protected] | |
with: | |
name: ${{ env.ARTIFACT_NAME1 }} | |
path: ./ | |
- name: Download Artifact x64 | |
uses: actions/[email protected] | |
with: | |
name: ${{ env.ARTIFACT_NAME2 }} | |
path: ./ | |
- name: Upload Artifact x86 to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{ env.ARTIFACT_NAME1 }} | |
asset_name: ${{ env.ARTIFACT_NAME1 }} | |
asset_content_type: application/x-7z-compressed | |
- name: Upload Artifact x64 to Release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./${{ env.ARTIFACT_NAME2 }} | |
asset_name: ${{ env.ARTIFACT_NAME2 }} | |
asset_content_type: application/x-7z-compressed |