Skip to content

Commit

Permalink
test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
BattleCh1cken committed May 8, 2024
1 parent 6d1b649 commit ca0a896
Showing 1 changed file with 16 additions and 33 deletions.
49 changes: 16 additions & 33 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ inputs:
upload-built-template:
required: false
default: true
project-name:
required: false
default: ${{ github.repository.name }}

runs:
using: composite
Expand All @@ -31,9 +34,9 @@ runs:
TEMPLATE: ${{ steps.template.outputs.template }}
shell: bash

- name: Get short SHA
- name: Get project info
if: ${{ steps.template.outputs.template == 1 && inputs.upload-built-template}}
id: short-sha
id: project-info
shell: bash
run: |
if [ $ACTION = opened ]; then
Expand All @@ -45,47 +48,27 @@ runs:
sha=$(echo "$AFTER" | head -c 6)
fi
echo "sha=$sha" >> $GITHUB_OUTPUT
env:
AFTER: ${{ github.event.after }} # this isn't present for pr opened events
ACTION: ${{github.event.action}}
PR_NUM: ${{github.event.number}}
SHA: ${{ steps.short-sha.outputs.sha }}
- name: Get version number
if: ${{ steps.template.outputs.template == 1 && inputs.upload-built-template}}
id: version
shell: bash
run: |
version=$(awk -F'=' '/^VERSION:=/{print $2}' Makefile)
echo "version=$version" >> "$GITHUB_OUTPUT"
env:
VER: ${{ steps.version.outputs.version }}
- name: Get Template Postfix
if: ${{ steps.template.outputs.template == 1 && inputs.upload-built-template}}
id: template-postfix
shell: bash
run: |
echo postfix="$VER+$SHA" >> "$GITHUB_OUTPUT"
env:
POSTFIX: ${{ steps.template-postfix.outputs.postfix }}
- name: Get Template Name
if: ${{ steps.template.outputs.template == 1 && inputs.upload-built-template}}
id: template-name
shell: bash
run: |
echo name=$TEMPLATE_NAME@$POSTFIX >> "$GITHUB_OUTPUT"
# Update version in Makefile
sed -i "s/^VERSION:=.*\$/VERSION:=$POSTFIX/" Makefile
env:
POSTFIX: ${{ steps.template-postfix.outputs.postfix }}
AFTER: ${{ github.event.after }} # this isn't present for pr opened events
ACTION: ${{github.event.action}}
PR_NUM: ${{github.event.number}}
TEMPLATE_NAME: ${{ github.event.repository.name }}

- name: Update version in Makefile
if: ${{ steps.template.outputs.template == 1 && inputs.upload-built-template}}
shell: bash
run: sed -i "s/^VERSION:=.*\$/VERSION:=$POSTFIX/" Makefile
env:
POSTFIX: ${{ steps.template-postfix.outputs.postfix }}
SHA: ${{ steps.project-info.outputs.sha }}
VER: ${{ steps.project-info.outputs.version }}
POSTFIX: ${{ steps.project-info.outputs.postfix }}
NAME: ${{ steps.project-info.outputs.name }}


#- name: Install ARM Toolchain
#uses: fiam/arm-none-eabi-gcc@v1
Expand Down

0 comments on commit ca0a896

Please sign in to comment.