update .wasm build #29
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build binary artifacts | |
on: | |
push: | |
tags: | |
- weekly.** | |
- 0.** | |
jobs: | |
build-linux: | |
runs-on: ubuntu-20.04 | |
env: | |
CC: gcc | |
ZIPNAME: vpaint_linux.zip | |
steps: | |
- name: Setup V | |
uses: vlang/setup-v@v1.4 | |
with: | |
# Default: ${{ github.token }} | |
token: ${{ github.token }} | |
version: 'weekly.2024.37' | |
version-file: '' | |
check-latest: true | |
stable: false | |
architecture: '' | |
- uses: actions/checkout@v1 | |
- name: Compile | |
run: | | |
sudo apt-get -qq update | |
sudo apt-get -qq install libgc-dev | |
sudo apt install build-essential | |
sudo apt-get --yes --force-yes install libxi-dev libxcursor-dev mesa-common-dev | |
sudo apt-get --yes --force-yes install libgl1-mesa-glx | |
v install https://github.com/pisaiah/ui | |
git clone https://github.com/pisaiah/ui iui | |
cd iui | |
git clone https://github.com/pisaiah/vpaint --depth 1 | |
v -cc $CC -skip-unused -gc boehm vpaint | |
- name: Remove excluded | |
run: | | |
rm -rf .git | |
rm -rf docs | |
cd iui | |
cd vpaint | |
rm -rf docs | |
rm -rf *.v | |
cd .. | |
cd .. | |
- name: Create ZIP archive | |
run: | | |
cd iui | |
zip -r9 --symlinks $ZIPNAME vpaint/ | |
mv $ZIPNAME ../ | |
cd .. | |
- name: Create artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: linux | |
path: vpaint_linux.zip | |
build-macos: | |
runs-on: macos-latest | |
env: | |
CC: clang | |
ZIPNAME: vpaint_macos.zip | |
steps: | |
- name: Setup V | |
uses: vlang/setup-v@v1.4 | |
with: | |
# Default: ${{ github.token }} | |
token: ${{ github.token }} | |
version: 'weekly.2024.37' | |
version-file: '' | |
check-latest: true | |
stable: false | |
architecture: '' | |
- uses: actions/checkout@v1 | |
- name: Compile | |
run: | | |
v install https://github.com/pisaiah/ui | |
git clone https://github.com/pisaiah/ui iui | |
cd iui | |
git clone https://github.com/pisaiah/vpaint --depth 1 | |
v -cc $CC -skip-unused -gc boehm vpaint | |
- name: Remove excluded | |
run: | | |
rm -rf .git | |
rm -rf docs | |
cd iui | |
cd vpaint | |
rm -rf docs | |
rm -rf *.v | |
cd .. | |
cd .. | |
- name: Create ZIP archive | |
run: | | |
cd iui | |
zip -r9 --symlinks $ZIPNAME vpaint/ | |
mv $ZIPNAME ../ | |
cd .. | |
- name: Create artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos | |
path: vpaint_macos.zip | |
build-windows: | |
runs-on: windows-latest | |
env: | |
CC: msvc | |
ZIPNAME: vpaint_windows.zip | |
steps: | |
- name: Setup V | |
uses: vlang/setup-v@v1.4 | |
with: | |
# Default: ${{ github.token }} | |
token: ${{ github.token }} | |
version: 'weekly.2024.37' | |
version-file: '' | |
check-latest: true | |
stable: false | |
architecture: '' | |
- uses: actions/checkout@v1 | |
- uses: msys2/setup-msys2@v2 | |
- name: Compile | |
run: | | |
where v | |
v install https://github.com/pisaiah/ui | |
git clone https://github.com/pisaiah/vpaint --depth 1 | |
v -cc gcc -skip-unused -gc boehm -cflags -static -cflags -mwindows vpaint | |
- name: Remove excluded | |
shell: msys2 {0} | |
run: | | |
rm -rf .git | |
rm -rf docs | |
cd vpaint | |
rm -rf docs | |
rm -rf *.v | |
cd .. | |
- name: Create archive | |
shell: msys2 {0} | |
run: | | |
cd vpaint | |
cd .. | |
powershell Compress-Archive vpaint $ZIPNAME | |
# NB: the powershell Compress-Archive line is from: | |
# https://superuser.com/a/1336434/194881 | |
# It is needed, because `zip` is not installed by default :-| | |
- name: Create artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: windows | |
path: vpaint_windows.zip | |
build-emscripten: | |
env: | |
EM_VERSION: 1.39.18 | |
EM_CACHE_FOLDER: 'emsdk-cache' | |
CC: gcc | |
ZIPNAME: vpaint_emscripten.zip | |
runs-on: ubuntu-latest | |
steps: | |
- uses: mymindstorm/setup-emsdk@v14 | |
- name: Setup emsdk | |
uses: mymindstorm/setup-emsdk@v14 | |
with: | |
# Make sure to set a version number! | |
version: 3.1.67 | |
# This is the name of the cache folder. | |
# The cache folder will be placed in the build directory, | |
# so make sure it doesn't conflict with anything! | |
actions-cache-folder: 'emsdk-cache' | |
- name: Verify | |
run: emcc -v | |
- name: Setup V | |
uses: vlang/setup-v@v1.4 | |
with: | |
# Default: ${{ github.token }} | |
token: ${{ github.token }} | |
version: 'weekly.2024.37' | |
version-file: '' | |
check-latest: true | |
stable: false | |
architecture: '' | |
- uses: actions/checkout@v1 | |
- name: Compile | |
run: | | |
sudo apt-get -qq update | |
sudo apt-get -qq install libgc-dev | |
sudo apt install build-essential | |
sudo apt-get --yes --force-yes install libxi-dev libxcursor-dev mesa-common-dev | |
sudo apt-get --yes --force-yes install libgl1-mesa-glx | |
v install https://github.com/pisaiah/ui | |
git clone https://github.com/pisaiah/ui iui | |
cd iui | |
git clone https://github.com/vlang/v --depth 1 | |
cd v | |
make | |
mv v v.exe | |
git clone https://github.com/pisaiah/v-emscripten-script | |
cd v-emscripten-script | |
../v.exe . -o v2w.exe | |
git clone https://github.com/pisaiah/vpaint --depth 1 | |
dir | |
./v2w.exe ../ vpaint -Os | |
- name: Remove excluded | |
run: | | |
rm -rf .git | |
- name: Create ZIP archive | |
run: | | |
cd iui | |
cd v | |
zip -r9 --symlinks $ZIPNAME v-emscripten-script/output/ | |
mv $ZIPNAME ../../ | |
cd .. | |
cd .. | |
- name: Create artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: emscripten | |
path: vpaint_emscripten.zip | |
release: | |
name: Create Github Release | |
needs: [build-linux, build-windows, build-macos, build-emscripten] | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Get short tag name | |
uses: winterjung/split@v2 | |
id: split | |
with: | |
msg: ${{ github.ref }} | |
separator: / | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.split.outputs._2 }} | |
name: ${{ steps.split.outputs._2 }} | |
commit: ${{ github.sha }} | |
draft: false | |
prerelease: false | |
publish: | |
needs: [release] | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
version: [linux, macos, windows, emscripten] | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Fetch artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ matrix.version }} | |
path: ./${{ matrix.version }} | |
- name: Get short tag name | |
uses: winterjung/split@v2 | |
id: split | |
with: | |
msg: ${{ github.ref }} | |
separator: / | |
- name: Get release | |
id: get_release_info | |
uses: leahlundqvist/get-release@v1.3.1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
tag_name: ${{ steps.split.outputs._2 }} | |
- name: Upload Release Asset | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1.0.1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | |
asset_path: ${{ matrix.version }}/vpaint_${{ matrix.version }}.zip | |
asset_name: vpaint_${{ matrix.version }}.zip | |
asset_content_type: application/zip |