# Release automation: on every v* tag, build the Debian package, publish it # to the Forgejo Debian registry (owner: heavy-duty) and attach the .deb to # the tag's release page as a fallback for direct `dpkg -i` installs. # # Requirements: # - A Forgejo Actions runner on the instance. Adjust `runs-on` to a label # your runner actually advertises (common: docker, ubuntu-latest). # - A repository/org secret RELEASE_TOKEN: a token with read:user, # write:package and write:repository scopes for an account allowed to # publish packages under the heavy-duty org. read:user is required because # publish-release.sh runs `stoke auth login`, which validates the token # against /user. name: release on: push: tags: - 'v*' jobs: deb: runs-on: docker container: image: node:22-bookworm steps: - name: Check out tag uses: actions/checkout@v4 - name: Run tests run: npm ci && npm test - name: Build .deb run: bash scripts/build-deb.sh - name: Publish to Debian registry env: STOKE_TOKEN: ${{ secrets.RELEASE_TOKEN }} run: bash scripts/publish-deb.sh dist/stoke_*_all.deb heavy-duty stable main - name: Create release and attach .deb env: RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} run: bash scripts/publish-release.sh "${{ github.ref_name }}" "$(node -p "require('./package.json').version")" "$(ls dist/stoke_*_all.deb)" "${{ github.repository_owner }}" stoke