Skip to content

Build automatically using GitHub workflow #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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@v4

- 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@v4
with:
name: ${{ steps.filename.outputs.archive }}
path: w64devkit-*.exe

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