Skip to content

Commit

Permalink
update release with github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hayguen committed Dec 14, 2022
1 parent aeb8880 commit beea22d
Showing 1 changed file with 92 additions and 0 deletions.
92 changes: 92 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@

name: Release Asset

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release


jobs:

release_job:

runs-on: ubuntu-latest
outputs:
upload_url: ${{steps.create_release.outputs.upload_url}}
release_version: ${{env.RELEASE_VERSION}}
steps:
- uses: actions/checkout@v2
- name: Get Release tag
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Precompiled ExtIO-DLL with README for Winrad/HDSDR
draft: false
prerelease: false


build-on-windows:
needs: [release_job]
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
# windows-latest or windows-2022 fail!?
runs-on: windows-2019

steps:

- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2
submodules: recursive

- name: Configure Visual Studio and CMake
working-directory: ${{runner.workspace}}
run: |
# setup the compiler
cmd.exe /c "call `"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat`" && set > %temp%\vcvars.txt"
Get-Content "$env:temp\vcvars.txt" | Foreach-Object { if ($_ -match "^(.*?)=(.*)$") { Set-Content "env:\$($matches[1])" $matches[2] } }
# run cmake, looks v141_xp Toolset requires VS 2019
cmake -G "Visual Studio 16 2019" -A Win32 -S ExtIO_RTL -B build_ExtIO_RTL
- name: Build
working-directory: ${{runner.workspace}}
shell: bash
run: cmake --build build_ExtIO_RTL --config $BUILD_TYPE --target ExtIO_RTL

- name: Collect files to distribute and create ZIP
working-directory: ${{runner.workspace}}
shell: bash
run: |
cp "${{runner.workspace}}/ExtIO_RTL/README.md" ./
cp "${{runner.workspace}}/ExtIO_RTL/COPYING" ./LICENSE
cp "${{runner.workspace}}/build_ExtIO_RTL/Release/ExtIO_RTL.dll" ./
7z a ExtIO_RTL_x32.zip README.md LICENSE ExtIO_RTL.dll
- name: Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object,
# which include a `upload_url`. See this blog post for more info:
# https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{needs.release_job.outputs.upload_url}}
asset_path: ${{runner.workspace}}/ExtIO_RTL_x32.zip
asset_name: ExtIO_RTL_x32_${{needs.release_job.outputs.release_version}}.zip
asset_content_type: application/zip

0 comments on commit beea22d

Please sign in to comment.