Skip to content

Commit 818f548

Browse files
committed
Add build and release workflows
1 parent 9641b6a commit 818f548

3 files changed

Lines changed: 197 additions & 1 deletion

File tree

.github/workflows/build-test.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build and Test
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
paths-ignore:
7+
- "**.md"
8+
- "screenshots/**"
9+
pull_request:
10+
branches: [main, master]
11+
12+
jobs:
13+
build-test:
14+
name: Build & Test (${{ matrix.os }})
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- name: Linux-x64
21+
os: ubuntu-latest
22+
asset_pattern: "qb64pe_lnx-*.tar.gz"
23+
- name: Windows-x64
24+
os: windows-latest
25+
asset_pattern: "qb64pe_win-x64-*.7z"
26+
- name: Windows-x86
27+
os: windows-latest
28+
asset_pattern: "qb64pe_win-x86-*.7z"
29+
- name: Windows-arm64
30+
os: windows-11-arm
31+
asset_pattern: "qb64pe_win-arm64-*.7z"
32+
- name: macOS-x64
33+
os: macos-latest
34+
asset_pattern: "qb64pe_osx-*.tar.gz"
35+
36+
steps:
37+
- name: Checkout code
38+
uses: actions/checkout@v4
39+
with:
40+
submodules: recursive
41+
42+
- name: Install dependencies (Linux)
43+
if: runner.os == 'Linux'
44+
run: |
45+
sudo apt-get update
46+
sudo apt-get install -y libasound2-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev libx11-dev libxext-dev
47+
48+
- name: Download QB64-PE
49+
env:
50+
GH_TOKEN: ${{ github.token }}
51+
run: |
52+
gh release download latest -R QB64-Phoenix-Edition/QB64pe -p "${{ matrix.asset_pattern }}" --dir qb64_dl
53+
54+
- name: Extract QB64-PE (Unix)
55+
if: runner.os != 'Windows'
56+
run: |
57+
mkdir qb64pe
58+
tar -xzf qb64_dl/*.tar.gz -C qb64pe --strip-components=1
59+
60+
- name: Extract QB64-PE (Windows)
61+
if: runner.os == 'Windows'
62+
run: |
63+
7z x qb64_dl/*.7z -oqb64pe
64+
# The Windows zip usually has a subfolder, let's find it and move contents up if needed
65+
$subFolder = Get-ChildItem -Path qb64pe -Directory | Select-Object -First 1
66+
if ($subFolder) {
67+
Move-Item -Path "$($subFolder.FullName)\*" -Destination qb64pe\
68+
}
69+
70+
- name: Build
71+
shell: bash
72+
run: |
73+
export QB64PE_PATH=$(pwd)/qb64pe
74+
make
75+
76+
- name: Run Tests
77+
shell: bash
78+
run: |
79+
export QB64PE_PATH=$(pwd)/qb64pe
80+
make test

.github/workflows/release.yml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build-release:
10+
name: Build Release (${{ matrix.os }})
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- name: Linux-x64
17+
os: ubuntu-latest
18+
asset_pattern: "qb64pe_lnx-*.tar.gz"
19+
bin_name: Brainfuck64
20+
archive_name: Brainfuck64-linux-x64.zip
21+
- name: Windows-x64
22+
os: windows-latest
23+
asset_pattern: "qb64pe_win-x64-*.7z"
24+
bin_name: Brainfuck64.exe
25+
archive_name: Brainfuck64-windows-x64.zip
26+
- name: Windows-x86
27+
os: windows-latest
28+
asset_pattern: "qb64pe_win-x86-*.7z"
29+
bin_name: Brainfuck64.exe
30+
archive_name: Brainfuck64-windows-x86.zip
31+
- name: Windows-arm64
32+
os: windows-11-arm
33+
asset_pattern: "qb64pe_win-arm64-*.7z"
34+
bin_name: Brainfuck64.exe
35+
archive_name: Brainfuck64-windows-arm64.zip
36+
- name: macOS-x64
37+
os: macos-latest
38+
asset_pattern: "qb64pe_osx-*.tar.gz"
39+
bin_name: Brainfuck64
40+
archive_name: Brainfuck64-macos-x64.zip
41+
42+
steps:
43+
- name: Checkout code
44+
uses: actions/checkout@v4
45+
with:
46+
submodules: recursive
47+
48+
- name: Install dependencies (Linux)
49+
if: runner.os == 'Linux'
50+
run: |
51+
sudo apt-get update
52+
sudo apt-get install -y libasound2-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev libx11-dev libxext-dev zip
53+
54+
- name: Download QB64-PE
55+
env:
56+
GH_TOKEN: ${{ github.token }}
57+
run: |
58+
gh release download latest -R QB64-Phoenix-Edition/QB64pe -p "${{ matrix.asset_pattern }}" --dir qb64_dl
59+
60+
- name: Extract QB64-PE (Unix)
61+
if: runner.os != 'Windows'
62+
run: |
63+
mkdir qb64pe
64+
tar -xzf qb64_dl/*.tar.gz -C qb64pe --strip-components=1
65+
66+
- name: Extract QB64-PE (Windows)
67+
if: runner.os == 'Windows'
68+
run: |
69+
7z x qb64_dl/*.7z -oqb64pe
70+
$subFolder = Get-ChildItem -Path qb64pe -Directory | Select-Object -First 1
71+
if ($subFolder) {
72+
Move-Item -Path "$($subFolder.FullName)\*" -Destination qb64pe\
73+
}
74+
75+
- name: Build
76+
shell: bash
77+
run: |
78+
export QB64PE_PATH=$(pwd)/qb64pe
79+
make
80+
81+
- name: Package (Unix)
82+
if: runner.os != 'Windows'
83+
run: |
84+
zip -r ${{ matrix.archive_name }} . -x ".git/*" ".github/*" "tests/*" "qb64_dl/*" "qb64pe/*" "*.o" "*.obj" "*.a" "*.lib" "Makefile"
85+
86+
- name: Package (Windows)
87+
if: runner.os == 'Windows'
88+
run: |
89+
7z a -tzip ${{ matrix.archive_name }} . -xr!.git -xr!.github -xr!tests -xr!qb64_dl -xr!qb64pe -x!*.o -x!*.obj -x!*.a -x!*.lib -x!Makefile
90+
91+
- name: Upload Artifact
92+
uses: actions/upload-artifact@v4
93+
with:
94+
name: ${{ matrix.archive_name }}
95+
path: ${{ matrix.archive_name }}
96+
97+
create-release:
98+
name: Create GitHub Release
99+
needs: build-release
100+
runs-on: ubuntu-latest
101+
permissions:
102+
contents: write
103+
steps:
104+
- name: Download all artifacts
105+
uses: actions/download-artifact@v4
106+
with:
107+
path: artifacts
108+
merge-multiple: true
109+
110+
- name: Create Release
111+
uses: softprops/action-gh-release@v2
112+
with:
113+
files: artifacts/*
114+
generate_release_notes: true
115+
draft: false
116+
prerelease: false

LICENSE.md renamed to LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Samuel Gomes
3+
Copyright (c) 2025 Samuel Gomes
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)