Skip to content

Commit

Permalink
Auto-Build Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tunmx committed May 6, 2024
1 parent 9c67577 commit d033daa
Showing 1 changed file with 16 additions and 28 deletions.
44 changes: 16 additions & 28 deletions .github/workflows/built_release_from_docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
tags:
- "v*"

# Set the global GitHub token environment variable
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}

jobs:
build:
Expand All @@ -23,43 +26,28 @@ jobs:
git submodule sync --recursive # Ensure submodule paths are up-to-date
git submodule update --init --recursive # Initialize and update all submodules
# Step 3: Extract the version number from the tag (e.g., "v1.2.3" becomes "1.2.3")
- name: Extract Version Number
id: extract_version
run: echo "VERSION=$(echo ${GITHUB_REF#refs/tags/} | sed 's/^v//')" >> $GITHUB_ENV

# Step 4: Build projects using Docker Compose
# Step 3: Build projects using Docker Compose
- name: Build SDKs with Docker Compose
run: docker-compose up

# Step 5: Rename directories with the extracted version number
- name: Rename SDK Directories with Version
run: |
mv build/inspireface-linux-armv7-armhf build/inspireface-linux-armv7-armhf-${{ env.VERSION }}
mv build/inspireface-linux-armv7-rv1109rv1126-armhf build/inspireface-linux-armv7-rv1109rv1126-armhf-${{ env.VERSION }}
mv build/inspireface-linux-x86-ubuntu18 build/inspireface-linux-x86-ubuntu18-${{ env.VERSION }}
# Step 6: Zip each SDK directory with the version number
# Step 4: Zip each SDK directory
- name: Zip SDK Files
run: |
zip -r inspireface-linux-armv7-armhf-${{ env.VERSION }}.zip build/inspireface-linux-armv7-armhf-${{ env.VERSION }}
zip -r inspireface-linux-armv7-rv1109rv1126-armhf-${{ env.VERSION }}.zip build/inspireface-linux-armv7-rv1109rv1126-armhf-${{ env.VERSION }}
zip -r inspireface-linux-x86-ubuntu18-${{ env.VERSION }}.zip build/inspireface-linux-x86-ubuntu18-${{ env.VERSION }}
zip -r inspireface-linux-armv7-armhf.zip build/inspireface-linux-armv7-armhf/
zip -r inspireface-linux-armv7-rv1109rv1126-armhf.zip build/inspireface-linux-armv7-rv1109rv1126-armhf/
zip -r inspireface-x86-linux-ubuntu18.zip build/inspireface-x86-linux-ubuntu18/
# Step 7: Upload the zipped SDK files for the next job
# Step 5: Upload the zipped SDK files for the next job
- name: Upload SDK Artifacts
uses: actions/upload-artifact@v2
with:
name: sdk_files
path: |
inspireface-linux-armv7-armhf-${{ env.VERSION }}.zip
inspireface-linux-armv7-rv1109rv1126-armhf-${{ env.VERSION }}.zip
inspireface-linux-x86-ubuntu18-${{ env.VERSION }}.zip
inspireface-linux-armv7-armhf.zip
inspireface-linux-armv7-rv1109rv1126-armhf.zip
inspireface-x86-linux-ubuntu18.zip
release:
# Set the global GitHub token environment variable
env:
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }}
name: Release SDKs to GitHub
needs: build
runs-on: ubuntu-latest
Expand All @@ -75,11 +63,11 @@ jobs:
with:
name: sdk_files

# Step 3: Create a GitHub Release and upload SDK files with the version number
# Step 3: Create a GitHub Release and upload the SDK files
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
inspireface-linux-armv7-armhf-${{ env.VERSION }}.zip
inspireface-linux-armv7-rv1109rv1126-armhf-${{ env.VERSION }}.zip
inspireface-linux-x86-ubuntu18-${{ env.VERSION }}.zip
inspireface-linux-armv7-armhf.zip
inspireface-linux-armv7-rv1109rv1126-armhf.zip
inspireface-x86-linux-ubuntu18.zip

0 comments on commit d033daa

Please sign in to comment.