Skip to content

Commit

Permalink
Release packages
Browse files Browse the repository at this point in the history
  • Loading branch information
smartnexus committed Feb 4, 2024
1 parent d5877f6 commit 0ab7eec
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
- main
pull_request:
jobs:
build-L475_monitoring_node:
build-L475_monitoring_node:
name: Build the L475_monitoring_node binary
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
with:
name: stm32-firmware-L475_monitoring_node-${{ steps.version_handling.outputs.file_postfix }}
path: stm32-firmware
build-L475_notifying_node:
build-L475_notifying_node:
name: Build the L475_notifying_node binary
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -116,4 +116,37 @@ jobs:
uses: actions/upload-artifact@v3.1.0
with:
name: stm32-firmware-L475_notifying_node-${{ steps.version_handling.outputs.file_postfix }}
path: stm32-firmware
path: stm32-firmware
release:
needs: [build-L475_notifying_node, build-L475_monitoring_node]
name: Release packages to Github
runs-on: ubuntu-20.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v3.0.1
with:
path: stm32-firmware
- name: Determine version
id: determine_version
run: |
if [ -n "$(find stm32-firmware -name 'stm32-firmware-L475_notifying_node-*-dev')" ]
then
version=0.0.0
file_postfix=$(find stm32-firmware -name "stm32-firmware-L475_notifying_node-*" | sed 's/stm32-firmware\/stm32-firmware-L475_notifying_node-\(.*\)/\1/')
else
version=$(find stm32-firmware -name "stm32-firmware-L475_notifying_node-*" | sed 's/stm32-firmware\/stm32-firmware-L475_notifying_node-\([0-9\.]*\)/\1/')
file_postfix=$version
fi
echo "version=$version" >> $GITHUB_OUTPUT
echo "file_postfix=$file_postfix" >> $GITHUB_OUTPUT
- name: Release to Github
id: create_release
uses: ncipollo/release-action@v1.11.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: v${{ steps.determine_version.outputs.file_postfix }}
name: v${{ steps.determine_version.outputs.file_postfix }}
commit: ${{ github.sha }}
draft: false
prerelease: false
artifacts: "stm32-firmware/stm32-firmware-*/*"

0 comments on commit 0ab7eec

Please sign in to comment.