luminate-old/.forgejo/workflows/release.yml
Brendan Szymanski 70731ec633 Initial CI/CD pipeline
## Description

Add Forgejo Actions CI pipeline with flatpak builds and tests.

Closes #<!-- issue number -->

## Type of change

- [ ] 🐛 Bug fix
- [ ]  New feature
- [ ] ♻️ Refactor / code cleanup
- [ ] 📖 Documentation
- [x] 🔧 Dependencies / build tooling

## How was this tested?

Verified CI pipeline runs successfully with flatpak builds and tests in Forgejo Actions.

## Checklist

- [ ] I have read the [contributing guide](CONTRIBUTING.md)
- [ ] My code follows the project's style guidelines
- [ ] I have added or updated tests as needed
- [ ] Documentation has been updated where applicable
- [ ] All existing tests pass

Pull request: (#3)

## Description

Add Forgejo Actions CI pipeline with flatpak builds and tests.

Closes #<!-- issue number -->

## Type of change

- [ ] 🐛 Bug fix
- [ ]  New feature
- [ ] ♻️ Refactor / code cleanup
- [ ] 📖 Documentation
- [x] 🔧 Dependencies / build tooling

## How was this tested?

Verified CI pipeline runs successfully with flatpak builds and tests in Forgejo Actions.

## Checklist

- [ ] I have read the [contributing guide](CONTRIBUTING.md)
- [ ] My code follows the project's style guidelines
- [ ] I have added or updated tests as needed
- [ ] Documentation has been updated where applicable
- [ ] All existing tests pass
Co-authored-by: Brendan Szymanski <hello@bscubed.dev>
Co-committed-by: Brendan Szymanski <hello@bscubed.dev>
2026-06-23 23:36:14 +00:00

60 lines
2.2 KiB
YAML

name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: docker
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-50
options: --privileged
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: https://github.com/flatpak/flatpak-github-actions/flatpak-builder@v6.7
with:
manifest-path: dev.bscubed.Luminate.json
bundle: Luminate.flatpak
cache-key: flatpak-builder-${arch}-${sha256(dev.bscubed.Luminate.json)}-release
branch: stable
repository-url: https://flathub.org/repo/flathub.flatpakrepo
upload-artifact: false
- name: Install tools
run: apt-get update -qq && apt-get install -y -qq jq
- name: Generate changelog
run: |
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -n "$PREV_TAG" ]; then
git log --oneline --no-decorate "$PREV_TAG..HEAD" > /tmp/changelog.md
else
echo "Initial release" > /tmp/changelog.md
fi
- name: Create Forgejo release
env:
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
run: |
TAG="${{ forge.ref_name }}"
REPO="${{ forge.repository }}"
API_URL="${{ forge.api_url }}"
jq -n --arg tag "$TAG" --rawfile body /tmp/changelog.md \
'{tag_name: $tag, name: $tag, body: $body}' > /tmp/release-payload.json
RESPONSE=$(curl -s -X POST \
-H "Authorization: token $FORGEJO_TOKEN" \
-H "Content-Type: application/json" \
-d @/tmp/release-payload.json \
"$API_URL/repos/$REPO/releases")
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then
echo "Failed to create release:"
echo "$RESPONSE"
exit 1
fi
curl -s -X POST \
-H "Authorization: token $FORGEJO_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary "@Luminate.flatpak" \
"$API_URL/repos/$REPO/releases/$RELEASE_ID/assets?name=Luminate-$TAG.flatpak"