From db0a3df0c3aaef016ac3d16191237b0bf716a388 Mon Sep 17 00:00:00 2001 From: Kenny <70860732+KennyOliver@users.noreply.github.com> Date: Fri, 3 Jan 2025 14:48:15 +0000 Subject: [PATCH 1/3] Add: Separate install scripts for macOS and Ubuntu --- scripts/install_macos.sh | 15 ++++++++++++--- scripts/install_ubuntu.sh | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/scripts/install_macos.sh b/scripts/install_macos.sh index 36371b6..2ff59da 100755 --- a/scripts/install_macos.sh +++ b/scripts/install_macos.sh @@ -1,10 +1,19 @@ #!/bin/bash +# Exit immediately if a command exits with a non-zero status +set -e + +# Rename file to flavorlang +echo "Renaming flavorlang-macos-latest to flavorlang" +mv flavorlang-macos-latest flavorlang + # Set execute permissions -chmod +x flavorlang-macos-latest +chmod +x flavorlang # Move to /usr/local/bin for easier access -sudo mv flavorlang-macos-latest /usr/local/bin/ +echo "Moving flavorlang to /usr/local/bin/" +sudo mv flavorlang /usr/local/bin/ # Run the executable -flavorlang-macos-latest --about +echo "Running FlavorLang interpreter..." +flavorlang --about diff --git a/scripts/install_ubuntu.sh b/scripts/install_ubuntu.sh index 412ee02..c050d9d 100755 --- a/scripts/install_ubuntu.sh +++ b/scripts/install_ubuntu.sh @@ -1,10 +1,19 @@ #!/bin/bash +# Exit immediately if a command exits with a non-zero status +set -e + +# Rename file to flavorlang +echo "Renaming flavorlang-ubuntu-latest to flavorlang" +mv flavorlang-ubuntu-latest flavorlang + # Set execute permissions -chmod +x flavorlang-ubuntu-latest +chmod +x flavorlang # Move to /usr/local/bin for easier access -sudo mv flavorlang-ubuntu-latest /usr/local/bin/ +echo "Moving flavorlang to /usr/local/bin/" +sudo mv flavorlang /usr/local/bin/ # Run the executable -flavorlang-ubuntu-latest --about +echo "Running FlavorLang interpreter..." +flavorlang --about From 9992184afe8c6ca9bd0349554e74def7f3d4f31f Mon Sep 17 00:00:00 2001 From: Kenny <70860732+KennyOliver@users.noreply.github.com> Date: Fri, 3 Jan 2025 14:49:11 +0000 Subject: [PATCH 2/3] Fix: Packaging by moving VSIX to root and include interpreter in ZIP #154 --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fcfedb9..d0a4364 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,8 @@ jobs: npm audit fix --force || true npx @vscode/vsce package mv *.vsix flavorlang-extension-${{ matrix.os }}.vsix + # Move the VSIX to the root directory + mv flavorlang-extension-${{ matrix.os }}.vsix ../ - name: Build FlavorLang interpreter working-directory: src @@ -44,7 +46,7 @@ jobs: # Make interpreter executable - name: Make interpreter executable - run: chmod +x src/flavorlang-${{ matrix.os }} + run: chmod +x flavorlang-${{ matrix.os }} # Copy the appropriate install.sh script - name: Copy install.sh From e4d722d337f592fd5bf191478f3e265a1da77d2f Mon Sep 17 00:00:00 2001 From: Kenny <70860732+KennyOliver@users.noreply.github.com> Date: Fri, 3 Jan 2025 15:00:20 +0000 Subject: [PATCH 3/3] Update build.yml #154 --- .github/workflows/build.yml | 63 ++++++++++++++----------------------- 1 file changed, 24 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0a4364..41cc9f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,28 +2,24 @@ name: Build & Release FlavorLang on: push: - branches: - - main + branches: [main] pull_request: - branches: - - main + branches: [main] release: types: [created] jobs: build: - name: Build FlavorLang & VS Code Extension + name: Build FlavorLang strategy: matrix: os: [ubuntu-latest, macos-latest] runs-on: ${{ matrix.os }} steps: - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set up Node.js - uses: actions/setup-node@v4 + - uses: actions/setup-node@v4 with: node-version: 20 @@ -33,62 +29,51 @@ jobs: npm ci npm audit fix --force || true npx @vscode/vsce package - mv *.vsix flavorlang-extension-${{ matrix.os }}.vsix - # Move the VSIX to the root directory - mv flavorlang-extension-${{ matrix.os }}.vsix ../ - name: Build FlavorLang interpreter working-directory: src run: make - - name: Rename FlavorLang interpreter - run: mv src/flavor src/flavorlang-${{ matrix.os }} + - name: Prepare release package + run: | + # Create staging directory + mkdir -p staging - # Make interpreter executable - - name: Make interpreter executable - run: chmod +x flavorlang-${{ matrix.os }} + # Copy and rename files + cp vscode-extension/*.vsix staging/flavorlang-extension-${{ matrix.os }}.vsix + cp src/flavor staging/flavor + chmod +x staging/flavor - # Copy the appropriate install.sh script - - name: Copy install.sh - run: | + # Copy appropriate install script if [[ "${{ matrix.os }}" == "macos-latest" ]]; then - cp scripts/install_macos.sh install.sh - elif [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then - cp scripts/install_ubuntu.sh install.sh + cp scripts/install_macos.sh staging/install.sh + else + cp scripts/install_ubuntu.sh staging/install.sh fi + chmod +x staging/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 + # Create ZIP + cd staging + zip -r ../flavorlang-${{ matrix.os }}.zip ./* - # Upload the ZIP as an artifact - - name: Upload release package + - name: Upload package uses: actions/upload-artifact@v4 with: name: flavorlang-${{ matrix.os }} path: flavorlang-${{ matrix.os }}.zip release: - name: Attach Artifacts to Release needs: build if: github.event_name == 'release' runs-on: ubuntu-latest steps: - - name: Download all artifacts + - name: Download artifacts uses: actions/download-artifact@v4 with: path: ./artifacts - # Debug step to verify file structure - - name: Debug file structure - run: | - echo "Contents of artifacts directory:" - ls -R ./artifacts - find ./artifacts -type f - - - name: Upload release artifacts + - name: Upload to release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} uses: softprops/action-gh-release@v1