Skip to content

just make it work with working build #20

just make it work with working build

just make it work with working build #20

Workflow file for this run

name: release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: write
pages: write
id-token: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Check out the tag that triggered this run
ref: ${{ github.ref_name }}
- name: update version in repo
env:
tag: ${{ github.ref_name }}
run: |
set -e
tmp=$(mktemp)
jq --arg version "$tag" '.versions |= [$version] + .' versions.json > "$tmp" && mv "$tmp" versions.json
git config --global user.name 'Alan Bits'
git config --global user.email 'alan@lnbits.com'
git commit -am "[CHORE] update version to $tag" || echo "No changes to commit."
git push || true
# Re-point the tag at this commit (matches your previous behavior)
git push --delete origin "$tag" || true
git tag -fa "$tag" -m "update via workflow"
git push --tags
- name: Verify prebuilt artifacts exist
run: |
set -e
ls -lh build || (echo "Missing build/ directory"; exit 1)
for f in fossa.ino.bootloader.bin fossa.ino.bin fossa.ino.partitions.bin; do
[ -f "build/$f" ] || { echo "Missing build/$f"; exit 1; }
done
# Optional: produce checksums
(cd build && sha256sum *.bin > checksums.txt)
cat build/checksums.txt
- name: Create or update GitHub release with local artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
set -e
if gh release view "$tag" >/dev/null 2>&1; then
echo "Release $tag exists; uploading assets..."
gh release upload "$tag" \
build/fossa.ino.bootloader.bin \
build/fossa.ino.bin \
build/fossa.ino.partitions.bin \
build/checksums.txt \
--clobber
else
echo "Creating release $tag with assets..."
gh release create "$tag" --generate-notes \
build/fossa.ino.bootloader.bin \
build/fossa.ino.bin \
build/fossa.ino.partitions.bin \
build/checksums.txt
fi
deploy:
needs: [ release ]
uses: ./.github/workflows/static.yml