Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ActoryOu committed Oct 31, 2024
1 parent d1174c5 commit 2074737
Showing 1 changed file with 37 additions and 25 deletions.
62 changes: 37 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ on:
workflow_dispatch:
inputs:
commit_id:
description: "Commit ID to tag and create a release for"
description: 'Commit ID to tag and create a release for'
required: true
version_number:
description: "Release Version Number (Eg, v1.0.0)"
description: 'Release Version Number (Eg, v1.0.0)'
required: true

jobs:
Expand All @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit_id }}
- name: Configure git identity
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
env:
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
run: |
git tag "$VERSION_NUMBER" -a -m "FreeRTOS-Plus-FAT Library $VERSION_NUMBER"
git tag "$VERSION_NUMBER" -a -m "FreeRTOS-Plus-TCP Library $VERSION_NUMBER"
git push origin --tags
- name: Verify tag on remote
env:
Expand All @@ -65,37 +65,37 @@ jobs:
- name: Install ZIP tools
run: sudo apt-get install zip unzip
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit_id }}
path: FreeRTOS-Plus-FAT
ref: ${{ github.event.inputs.version_number }}
path: FreeRTOS-Plus-TCP
submodules: recursive
- name: Checkout disabled submodules
run: |
cd FreeRTOS-Plus-FAT
cd FreeRTOS-Plus-TCP
git submodule update --init --checkout --recursive
- name: Create ZIP
env:
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
run: |
zip -r FreeRTOS-Plus-FAT-"$VERSION_NUMBER".zip FreeRTOS-Plus-FAT -x "*.git*"
zip -r FreeRTOS-Plus-TCP-"$VERSION_NUMBER".zip FreeRTOS-Plus-TCP -x "*.git*"
ls ./
- name: Validate created ZIP
env:
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
run: |
mkdir zip-check
mv FreeRTOS-Plus-FAT-"$VERSION_NUMBER".zip zip-check
mv FreeRTOS-Plus-TCP-"$VERSION_NUMBER".zip zip-check
cd zip-check
unzip FreeRTOS-Plus-FAT-"$VERSION_NUMBER".zip -d FreeRTOS-Plus-FAT-"$VERSION_NUMBER"
ls FreeRTOS-Plus-FAT-"$VERSION_NUMBER"
diff -r -x "*.git*" FreeRTOS-Plus-FAT-"$VERSION_NUMBER"/FreeRTOS-Plus-FAT/ ../FreeRTOS-Plus-FAT/
unzip FreeRTOS-Plus-TCP-"$VERSION_NUMBER".zip -d FreeRTOS-Plus-TCP-"$VERSION_NUMBER"
ls FreeRTOS-Plus-TCP-"$VERSION_NUMBER"
diff -r -x "*.git*" FreeRTOS-Plus-TCP-"$VERSION_NUMBER"/FreeRTOS-Plus-TCP/ ../FreeRTOS-Plus-TCP/
cd ../
- name: Build
env:
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
run: |
cd zip-check/FreeRTOS-Plus-FAT-"$VERSION_NUMBER"/FreeRTOS-Plus-FAT
cd zip-check/FreeRTOS-Plus-TCP-"$VERSION_NUMBER"/FreeRTOS-Plus-TCP
sudo apt-get install -y lcov
sudo apt-get install unifdef
cmake -S test/unit-test -B test/unit-test/build/
Expand All @@ -104,20 +104,18 @@ jobs:
env:
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
run: |
cd zip-check/FreeRTOS-Plus-FAT-"$VERSION_NUMBER"/FreeRTOS-Plus-FAT
cd zip-check/FreeRTOS-Plus-TCP-"$VERSION_NUMBER"/FreeRTOS-Plus-TCP
pushd test/unit-test/build/
ctest -E system --output-on-failure
popd
make -C test/unit-test/build/ coverage
lcov --list --rc lcov_branch_coverage=1 test/unit-test/build/coverage.info
cd ..
- name: Create artifact of ZIP
env:
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: FreeRTOS-Plus-FAT-"$VERSION_NUMBER".zip
path: zip-check/FreeRTOS-Plus-FAT-"$VERSION_NUMBER".zip
name: FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}.zip
path: zip-check/FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}.zip
deploy-doxygen:
needs: tag-commit
name: Deploy doxygen documentation
Expand All @@ -143,20 +141,34 @@ jobs:
with:
tag_name: ${{ github.event.inputs.version_number }}
release_name: ${{ github.event.inputs.version_number }}
body: Release ${{ github.event.inputs.version_number }} of the FreeRTOS-Plus-FAT Library.
body: Release ${{ github.event.inputs.version_number }} of the FreeRTOS-Plus-TCP Library.
draft: false
prerelease: false
- name: Download ZIP artifact
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4
with:
name: FreeRTOS-Plus-FAT-${{ github.event.inputs.version_number }}.zip
name: FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}.zip
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./FreeRTOS-Plus-FAT-${{ github.event.inputs.version_number }}.zip
asset_name: FreeRTOS-Plus-FAT-${{ github.event.inputs.version_number }}.zip
asset_path: ./FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}.zip
asset_name: FreeRTOS-Plus-TCP-${{ github.event.inputs.version_number }}.zip
asset_content_type: application/zip
cleanup:
needs:
- create-release
name: Cleanup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Delete branch created for Tag by SBOM generator
env:
VERSION_NUMBER: ${{ github.event.inputs.version_number }}
run: |
# Delete the branch created for Tag by SBOM generator
git push -u origin --delete refs/heads/"$VERSION_NUMBER"

0 comments on commit 2074737

Please sign in to comment.