Skip to content

Commit

Permalink
Fix workflow output names, regex, & bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
bandogora committed Feb 14, 2024
1 parent d8eefdd commit 9bed509
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
run: west update

- name: Create west cache
if: ${{ steps.west-cache.outputs.cache-hit != 'true' }}
if: steps.west-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ jobs:
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GH_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${OWNER}/${REPO}/releases" \
-d '{"tag_name":"${{ env.version }}","target_commitish":"${BRANCH}","draft":false,"prerelease":false,"generate_release_notes":true}' \
"https://api.github.com/repos/${{ env.OWNER }}/${{ env.REPO }}/releases" \
-d '{"tag_name":"${{ env.version_tag }}","target_commitish":"${{ env.BRANCH }}","draft":false,"prerelease":false,"generate_release_notes":true}' \
-o release.json
echo "release_id=$(grep -Po '"id":.*?[^\\]",' release.json)" >> "$GITHUB_ENV"
echo "upload_url=$(grep -Po '"upload_url":.*?[^\\]",' release.json)" >> "$GITHUB_ENV"
echo "upload_url=$(grep -Po '(?:\G(?!^)",|"upload_url":\s*)\s*"\K[^"]+' release.json)" >> "$GITHUB_ENV"
echo 'curl url: "https://api.github.com/repos/${{ env.OWNER }}/${{ env.REPO }}/releases"' >> $GITHUB_STEP_SUMMARY
echo 'curl data: {"tag_name":"${{ env.version_tag }}","target_commitish":"${{ env.BRANCH }}","draft":false,"prerelease":false,"generate_release_notes":true}' >> $GITHUB_STEP_SUMMARY
cat release.json >> $GITHUB_STEP_SUMMARY
- name: Download merged.hex
uses: actions/download-artifact@v4
Expand All @@ -74,6 +76,7 @@ jobs:
-H "Content-Type: application/octet-stream" \
"${{ env.upload_url }}?name=merged-${{ env.version_tag }}.hex" \
--data-binary "merged.hex"
echo 'curl url: "${{ env.upload_url }}?name=merged-${{ env.version_tag }}.hex"' >> $GITHUB_STEP_SUMMARY
- name: Upload app_update.bin
env:
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/version_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ jobs:
version_check:
runs-on: ubuntu-latest
outputs:
version_increased: ${{ steps.version_up.outputs.vup }}
version_tag: ${{ steps.version_tag.outputs.tag }}
vup: ${{ steps.version_up.outputs.vup }}
vtag: ${{ steps.version_tag.outputs.vtag }}
steps:
- name: Git checkout
uses: actions/checkout@v4
Expand All @@ -23,25 +23,24 @@ jobs:
echo "vup=$vup" >> "$GITHUB_OUTPUT"
echo "Version increased: $vup" >> $GITHUB_STEP_SUMMARY
- name: Create version tag
if: ${{ steps.version_up.outputs.version_up == true }}
if: steps.version_up.outputs.vup == 'true'
id: version_tag
run: |
tag=v$(awk 'NR<4{printf "%s%s", sep, $3; sep="."} END{print ""}' app/VERSION)
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "vtag=$tag" >> "$GITHUB_OUTPUT"
echo "Version tag: $tag" >> $GITHUB_STEP_SUMMARY
release:
if: ${{ needs.version_check.outputs.version_up == true }}
if: needs.version_check.outputs.vup == 'true'
needs: version_check
uses: ./.github/workflows/release.yml
with:
version_tag: ${{ needs.version_check.outputs.version_tag }}
version_tag: ${{ needs.version_check.outputs.vtag }}
secrets: inherit

build:
if: ${{ needs.version_check.outputs.version_up == false }}
if: needs.version_check.outputs.vup == 'false'
needs: version_check
uses: ./.github/workflows/build.yml
with:
Expand Down
2 changes: 1 addition & 1 deletion app/VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
VERSION_MAJOR = 0
VERSION_MINOR = 2
PATCHLEVEL = 0
PATCHLEVEL = 1
VERSION_TWEAK = 0
EXTRAVERSION = nightly

0 comments on commit 9bed509

Please sign in to comment.