Skip to content

Commit

Permalink
release #96
Browse files Browse the repository at this point in the history
  • Loading branch information
yousefvand committed Nov 30, 2024
1 parent 132b2c2 commit 8406bc9
Showing 1 changed file with 27 additions and 42 deletions.
69 changes: 27 additions & 42 deletions .github/workflows/cmake-multi-platform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [main]

jobs:
build-and-release:
build:
runs-on: ${{ matrix.os }}

strategy:
Expand All @@ -27,7 +27,8 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

# Ubuntu build
# Step 2: Build and Package by OS
# Ubuntu
- name: Install dependencies (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
Expand All @@ -48,20 +49,12 @@ jobs:
- name: Package Notepad-- (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
BUILD_DIR="${{ github.workspace }}/build"
OUTPUT_DIR="${{ github.workspace }}/artifacts"
mkdir -p $OUTPUT_DIR
tar -czvf $OUTPUT_DIR/Notepad--_ubuntu.tar.gz -C $BUILD_DIR .
echo "Packaging completed. Listing artifacts directory:"
ls -al $OUTPUT_DIR
- name: Upload Ubuntu Artifact
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v3
with:
name: Notepad--_ubuntu
path: "${{ github.workspace }}/artifacts/Notepad--_ubuntu.tar.gz"
mkdir -p artifacts
tar -czvf artifacts/Notepad--_ubuntu.tar.gz -C "${{ github.workspace }}/build" .
echo "Artifact packaged:"
ls -al artifacts/
# macOS build
# macOS
- name: Install dependencies (macOS)
if: matrix.os == 'macos-latest'
run: |
Expand All @@ -79,20 +72,12 @@ jobs:
- name: Package Notepad-- (macOS)
if: matrix.os == 'macos-latest'
run: |
BUILD_DIR="${{ github.workspace }}/build"
OUTPUT_DIR="${{ github.workspace }}/artifacts"
mkdir -p $OUTPUT_DIR
zip -r $OUTPUT_DIR/Notepad--_macos.zip $BUILD_DIR
echo "Packaging completed. Listing artifacts directory:"
ls -al $OUTPUT_DIR
- name: Upload macOS Artifact
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: Notepad--_macos
path: "${{ github.workspace }}/artifacts/Notepad--_macos.zip"
mkdir -p artifacts
zip -r artifacts/Notepad--_macos.zip "${{ github.workspace }}/build"
echo "Artifact packaged:"
ls -al artifacts/
# Windows build
# Windows
- name: Install dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
Expand Down Expand Up @@ -124,23 +109,22 @@ jobs:
- name: Package Notepad-- (Windows)
if: matrix.os == 'windows-latest'
run: |
$BUILD_DIR="${{ github.workspace }}\\build"
$OUTPUT_DIR="${{ github.workspace }}\\artifacts"
mkdir $OUTPUT_DIR
Compress-Archive -Path "$BUILD_DIR\\*" -DestinationPath "$OUTPUT_DIR\\Notepad--_windows.zip"
echo "Packaging completed. Listing artifacts directory:"
Get-ChildItem -Path $OUTPUT_DIR
mkdir artifacts
Compress-Archive -Path "${{ github.workspace }}\\build\\*" -DestinationPath artifacts\\Notepad--_windows.zip
echo "Artifact packaged:"
Get-ChildItem artifacts
shell: pwsh
- name: Upload Windows Artifact
if: matrix.os == 'windows-latest'

# Upload artifacts for all OSes
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: Notepad--_windows
path: "${{ github.workspace }}\\artifacts\\Notepad--_windows.zip"
name: Notepad--_artifacts_${{ matrix.os }}
path: artifacts/*

release:
runs-on: ubuntu-latest
needs: build-and-release
needs: build
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -163,26 +147,27 @@ jobs:
draft: false
prerelease: false

# Upload artifacts to release
- name: Upload Ubuntu Artifact
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "${{ github.workspace }}/artifacts/Notepad--_ubuntu.tar.gz"
asset_path: artifacts/Notepad--_ubuntu.tar.gz
asset_name: Notepad--_ubuntu.tar.gz
asset_content_type: application/gzip

- name: Upload macOS Artifact
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "${{ github.workspace }}/artifacts/Notepad--_macos.zip"
asset_path: artifacts/Notepad--_macos.zip
asset_name: Notepad--_macos.zip
asset_content_type: application/zip

- name: Upload Windows Artifact
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: "${{ github.workspace }}\\artifacts\\Notepad--_windows.zip"
asset_path: artifacts/Notepad--_windows.zip
asset_name: Notepad--_windows.zip
asset_content_type: application/zip

0 comments on commit 8406bc9

Please sign in to comment.