Skip to content

Commit

Permalink
Add GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Semphriss committed Aug 2, 2024
1 parent 15ae179 commit ea37e81
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build and test

on:
pull_request: {}
push:
branches:
- '*'
tags:
- '*'

# Must set Settings -> Actions -> General -> Workflow permissions to
# "Read and write permissions"
permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
arch: ["x64", "x86"]

steps:
- uses: actions/checkout@v3

- name: Apply x86 patch
if: matrix.arch == 'x86'
run: patch -p1 -i src/variant-x86.patch

- name: Generate archive name and version string
id: filename
env:
ARCH: ${{ matrix.arch }}
run: |
GIT_VERSION="$(git describe --tags --always)"
echo "version=${GIT_VERSION:1}" >> $GITHUB_OUTPUT
echo "archive=w64devkit-$ARCH-${GIT_VERSION:1}" >> $GITHUB_OUTPUT
- name: Build
run: |
docker build -t w64devkit .
docker run --rm w64devkit > ${{ steps.filename.outputs.archive }}.exe
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ steps.filename.outputs.archive }}
path: w64devkit-*.exe

- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.filename.outputs.version }}
files: w64devkit-*.exe
draft: true

0 comments on commit ea37e81

Please sign in to comment.