Skip to content

Commit

Permalink
Update GitHub actions to acommodate Linux builds
Browse files Browse the repository at this point in the history
  • Loading branch information
drake127 committed Sep 11, 2024
1 parent 4869f77 commit 9b9ac7f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 17 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build sources

on: [push, workflow_call, workflow_dispatch]

jobs:
build_linux:
name: Linux build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build
working-directory: ./sources/rand
run: make

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: linux-artifact
path: ./sources/rand/rand.so
if-no-files-found: error
retention-days: 7

build_windows:
name: Windows build
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2

- name: Build
run: 'MSBuild.exe sources/cpuid-rdrand/cpuid-rdrand.vcxproj /p:Platform=x64 /p:Configuration=Release'

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: windows-artifact
path: |
.\sources\cpuid-rdrand\x64\Release\cpuid-rdrand.exe
.\sources\cpuid-rdrand\x64\Release\cpuid-rdrand.pdb
if-no-files-found: error
retention-days: 7
36 changes: 19 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,34 @@ on:
push:
tags:
- v*
workflow_dispatch:

jobs:
windows_msvc:
name: windows-msvc
runs-on: windows-2022
build_artifacts:
name: Build artifacts
uses: ./.github/workflows/build.yml

create_release:
name: Create release
needs: build_artifacts
runs-on: ubuntu-latest

steps:
- name: Checkout Sources
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Build Sources
env:
MSBUILD_PATH: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\MSBuild\\Current\\Bin\\"
shell: cmd
run: '"%MSBUILD_PATH%MSBuild.exe" sources/cpuid-rdrand.vcxproj /p:Platform=x64 /p:Configuration=Release'
- name: Fetch build artifacts
uses: actions/download-artifact@v4

- name: Pack artifacts
shell: cmd
- name: Create a mod package
run: |
mkdir randomrolls\tools
copy sources\x64\Release\cpuid-rdrand.exe randomrolls\tools\
copy sources\x64\Release\cpuid-rdrand.pdb randomrolls\tools\
copy README randomrolls\readme.txt
7z.exe a randomrolls.zip randomrolls Setup-randomrolls.exe
mkdir randomrolls/tools
cp windows-artifact/cpuid-rdrand.exe randomrolls/tools/
cp windows-artifact/cpuid-rdrand.pdb randomrolls/tools/
cp README randomrolls/readme.txt
7z a randomrolls.zip randomrolls Setup-randomrolls.exe
- name: Create Release
- name: Create a release
id: create_release
uses: actions/create-release@v1
env:
Expand Down

0 comments on commit 9b9ac7f

Please sign in to comment.