Skip to content

Commit

Permalink
Merge pull request #166 from KennyOliver/issue-154
Browse files Browse the repository at this point in the history
Issue 154: Add: Package build artifacts into ZIPs with `install.sh`
  • Loading branch information
KennyOliver authored Jan 3, 2025
2 parents adb7851 + 565892c commit 16b8480
Showing 1 changed file with 44 additions and 13 deletions.
57 changes: 44 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,53 @@ jobs:
- name: Rename FlavorLang interpreter
run: mv src/flavor src/flavorlang-${{ matrix.os }}

# **New Step: Make Interpreter Executable**
# Make interpreter executable
- name: Make interpreter executable
run: chmod +x src/flavorlang-${{ matrix.os }}

# Upload artifacts separately for clarity
- name: Upload VS Code extension
uses: actions/upload-artifact@v4
with:
name: vscode-extension-${{ matrix.os }}
path: vscode-extension/flavorlang-extension-${{ matrix.os }}.vsix
# Create install.sh script
- name: Create install.sh
run: |
if [[ "${{ matrix.os }}" == "macos-latest" ]]; then
cat <<EOF > install.sh
#!/bin/bash

# Set execute permissions
chmod +x flavorlang-macos-latest

# Move to /usr/local/bin for easier access
sudo mv flavorlang-macos-latest /usr/local/bin/

# Run the executable
flavorlang-macos-latest --about
EOF
elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
cat <<EOF > install.sh
#!/bin/bash

# Set execute permissions
chmod +x flavorlang-ubuntu-latest

# Move to /usr/local/bin for easier access
sudo mv flavorlang-ubuntu-latest /usr/local/bin/

# Run the executable
flavorlang-ubuntu-latest --about
EOF
fi
chmod +x install.sh

# Package interpreter, VSIX, and install.sh into a ZIP
- name: Package release assets
run: |
zip -r flavorlang-${{ matrix.os }}.zip flavorlang-${{ matrix.os }} flavorlang-extension-${{ matrix.os }}.vsix install.sh
- name: Upload interpreter
# Upload the ZIP as an artifact
- name: Upload release package
uses: actions/upload-artifact@v4
with:
name: interpreter-${{ matrix.os }}
path: src/flavorlang-${{ matrix.os }}
name: flavorlang-${{ matrix.os }}
path: flavorlang-${{ matrix.os }}.zip

release:
name: Attach Artifacts to Release
Expand All @@ -71,7 +102,7 @@ jobs:
with:
path: ./artifacts

# Debug step to see file structure
# Debug step to verify file structure
- name: Debug file structure
run: |
echo "Contents of artifacts directory:"
Expand All @@ -84,5 +115,5 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: |
./artifacts/**/flavorlang-extension-*.vsix
./artifacts/**/flavorlang-*-latest
./artifacts/**/flavorlang-ubuntu-latest.zip
./artifacts/**/flavorlang-macos-latest.zip

0 comments on commit 16b8480

Please sign in to comment.