Skip to content

Merge pull request #26 from ThePotato97/more-hashes #96

Merge pull request #26 from ThePotato97/more-hashes

Merge pull request #26 from ThePotato97/more-hashes #96

name: Build Windows Executable
on:
push:
branches:
- '*'
tags:
- '*'
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- 'extra/**'
pull_request:
branches:
- '*'
paths-ignore:
- '.github/ISSUE_TEMPLATE/**'
- 'extra/**'
workflow_dispatch:
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Make archive
run: |
$workspace = "${{ github.workspace }}"
mkdir -p $workspace\package
cp $workspace\build\Release\Hellextractor.exe $workspace\package\
cp $workspace\types.txt $workspace\package\
cp $workspace\files.txt $workspace\package\
cp $workspace\strings.txt $workspace\package\
cp $workspace\README.adoc $workspace\package\
cp $workspace\LICENSE.adoc $workspace\package\
cp $workspace\hellextractor.ps1 $workspace\package\
cp $workspace\hellextractor.cmd $workspace\package\
Compress-Archive -Path $workspace\package\* -DestinationPath $workspace\hellextractor.zip
shell: pwsh
- name: Upload hellextractor Artifact
uses: actions/[email protected]
with:
name: hellextractor
path: |
${{github.workspace}}/package/*
if-no-files-found: error # Optional: 'warn', 'error', 'ignore'
- name: Generate Release Name, Tag, and Notes
id: release_info
run: |
VERSION=$(LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 grep -hoPe "[0-9]+\.[0-9]+\.[0-9]+([abc][0-9]+|)" "${{ github.workspace }}/build/generated/version.h")
echo "tag=${VERSION}" >> $GITHUB_OUTPUT
dateName=$(date +'%Y-%m-%d %H:%M:%S')
echo "name=Hellextractor v${VERSION}" >> $GITHUB_OUTPUT
commitMessages=$(git log -25 --pretty=format:"%h - %s <br />" | paste -sd ' ' -)
echo "commitMessages=$commitMessages" # for debugging
releaseNotes="Recent changes: <br />$commitMessages"
echo "notes=$releaseNotes" >> $GITHUB_OUTPUT
shell: bash
if: (github.event_name != 'pull_request') && (github.ref_name == 'root')
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.release_info.outputs.tag }}
name: ${{ steps.release_info.outputs.name }}
body: ${{ steps.release_info.outputs.notes }}
files: |
hellextractor.zip
fail_on_unmatched_files: true
prerelease: ${{ github.ref_type != 'tag' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: (github.event_name != 'pull_request') && (github.ref_name == 'root')