Merge pull request #195 from KennyOliver/issue-194 #164
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 & Release FlavorLang | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
release: | |
types: [created] | |
jobs: | |
build: | |
name: Build FlavorLang | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Build VS Code extension | |
working-directory: vscode-extension | |
run: | | |
npm ci | |
npm audit fix --force || true | |
npx @vscode/vsce package | |
- name: Build FlavorLang interpreter | |
working-directory: src | |
run: make | |
- name: Prepare release package | |
run: | | |
# Create staging directory | |
mkdir -p staging | |
# Copy and rename files | |
cp vscode-extension/*.vsix staging/flavorlang-extension-${{ matrix.os }}.vsix | |
cp src/flavor staging/flavor | |
chmod +x staging/flavor | |
# Copy appropriate install script | |
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then | |
cp scripts/install_macos.sh staging/install.sh | |
else | |
cp scripts/install_ubuntu.sh staging/install.sh | |
fi | |
chmod +x staging/install.sh | |
# Create ZIP | |
cd staging | |
zip -r ../flavorlang-${{ matrix.os }}.zip ./* | |
- name: Upload package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: flavorlang-${{ matrix.os }} | |
path: flavorlang-${{ matrix.os }}.zip | |
release: | |
needs: build | |
if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./artifacts | |
- name: Upload to release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./artifacts/**/flavorlang-ubuntu-latest.zip | |
./artifacts/**/flavorlang-macos-latest.zip |