New CI flow for Climb OBC Software #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: New CI flow for Climb OBC Software | |
on: | |
push: | |
branches: [ develop ] | |
paths-ignore: | |
- '.github/**' | |
release: | |
types: [created] | |
workflow_dispatch: | |
jobs: | |
prepBuild: | |
runs-on: ubuntu-latest | |
name: Prepare Build Variables | |
outputs: | |
obcVersion: ${{ steps.create_ver.outputs.THE_SWVERSION }} | |
obcVersion2: ${{ steps.create_ver.outputs.MY_SWVERSION }} | |
steps: | |
- id: create_ver | |
name: Set Variables | |
run: | | |
THE_SWVERSION=$(printf '%.8s' "${{ github.sha }}" ) | |
MY_SWVERSION=$(printf '%.10s' "$GITHUB_REF_NAME" ) | |
#echo "THE_SWVERSION=$THE_SWVERSION" >> $GITHUB_ENV | |
#echo "MY_SWVERSION=$MY_SWVERSION" >> $GITHUB_ENV | |
echo "THE_SWVERSION=$THE_SWVERSION" >> "$GITHUB_OUTPUT" | |
echo "MY_SWVERSION=$MY_SWVERSION" >> "$GITHUB_OUTPUT" | |
echo "jobs output obcVersion set to '$THE_SWVERSION'" | |
echo "jobs output obcVersion2 set to '$MY_SWVERSION''" | |
buildDoc: | |
runs-on: ubuntu-latest | |
needs: prepBuild | |
name: Build the Documentation | |
steps: | |
- env: | |
OBC_VERSION: ${{needs.prepBuild.outputs.obcVersion2}} | |
name: simulate pdf creation | |
run: | | |
echo "$OBC_VERSION" | |
echo dummy build creating pdf ... | |
echo "dummy content for pdf" >> ./ClimbObcManual.pdf | |
pwd | |
ls | |
- name: Upload Document | |
uses: actions/upload-artifact@v3 | |
id: upload-axf | |
with: | |
name: 'BuildResult' | |
path: ./ClimbObcManual.pdf | |
#path: ${{ steps.publish-document.outputs.pdf }} | |
if-no-files-found: error | |
buildIt: | |
runs-on: ubuntu-latest | |
needs: prepBuild | |
name: Build the Software artefacts | |
strategy: | |
matrix: | |
kind: ['obc', 'dev'] | |
include: | |
- kind: obc | |
board: BA_CLIMBOBC | |
- kind: dev | |
board: BA_OM13085_EM2T | |
steps: | |
- env: | |
OBC_VERSION: ${{needs.prepBuild.outputs.obcVersion2}} | |
name: simulate build | |
run: | | |
echo "$OBC_VERSION" | |
echo dummy build creating result ... | |
echo "dummy content for ${{ matrix.kind }}" | |
echo "dummy content for ${{ matrix.kind }}" >> ./ClimbObc${{ env.OBC_VERSION }}-${{ matrix.kind }}.axf | |
pwd | |
ls | |
- name: Upload Binary | |
env: | |
MY_SWVERSION: ${{needs.prepBuild.outputs.obcVersion2}} | |
uses: actions/upload-artifact@v3 | |
id: upload-axf | |
with: | |
name: 'BuildResult' | |
path: ClimbObc${{ env.MY_SWVERSION }}-${{ matrix.kind }}.axf | |
if-no-files-found: error | |
releaseJob: | |
if: github.event_name == 'release' && github.event.action == 'created' | |
runs-on: ubuntu-latest | |
needs: [ buildIt, buildDoc ] | |
steps: | |
- name: Download all the build files | |
uses: actions/download-artifact@v3 | |
with: | |
name: 'BuildResult' | |
path: ./ | |
- name: show path | |
run: | | |
ls | |
zip artefacts.zip *.* | |
ls | |
- name: upload reelese assets | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: artefacts.zip | |
asset_name: archive_zip | |
asset_content_type: application/zip | |