Skip to content

Commit

Permalink
fix: fixed the release builder?
Browse files Browse the repository at this point in the history
  • Loading branch information
8char committed Dec 22, 2022
1 parent e3fcb71 commit 2240961
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 36 deletions.
71 changes: 35 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
# name: Build and Deploy
name: Build and Deploy

# on:
# push:
# branches:
# - main
on:
push:
branches:
- main

# jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Download and install LAUX
# run: |
# git clone https://github.com/8char/laux-compiler.git
# cd laux-compiler
# npm install
# npm run build
# npm link
# cd ..
# timeout-minutes: 0.25
# - name: Compile repository
# run: lauxc workspace
# - name: Delete files and folders
# run: |
# rm -rf $(find . -type f ! -name 'lua' ! -name 'materials')
# rm -rf $(find . -type d ! -name 'lua' ! -name 'materials')
# - name: Create release artifact
# run: zip -r artifact.zip .
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Upload release artifact
# uses: actions/upload-release-asset@v1
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: artifact.zip
# asset_name: release.zip
# asset_content_type: application/zip
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download and install LAUX
run: |
git clone https://github.com/8char/laux-compiler.git
cd laux-compiler
npm install
npm run build
npm link
cd ..
- name: Compile repository
run: ./transpile.sh
- name: Delete files and folders
run: |
rm -rf $(find . -type f ! -name 'lua' ! -name 'materials')
rm -rf $(find . -type d ! -name 'lua' ! -name 'materials')
- name: Create release artifact
run: zip -r artifact.zip .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload release artifact
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: artifact.zip
asset_name: release.zip
asset_content_type: application/zip
19 changes: 19 additions & 0 deletions transpile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Run the transpiler in the background
lauxc workspace &

# Get the process ID of the transpiler
transpiler_pid=$!

# Wait for 20 seconds
sleep 20

# Check if the transpiler is still running
if kill -0 "$transpiler_pid" >/dev/null 2>&1; then
# If it is, kill it
kill "$transpiler_pid"
fi

# Finally exit!
exit 0

0 comments on commit 2240961

Please sign in to comment.