name: CI on: push: branches: [main] tags: ['v*'] pull_request: workflow_dispatch: env: REGISTRY: ghcr.io IMAGE_NAME: ghcr.io/sulfurnitride/fluorine-builder jobs: build: runs-on: ubuntu-latest permissions: contents: read packages: write steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Log in to GHCR uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Build Docker image uses: docker/build-push-action@v6 with: context: docker file: docker/Dockerfile load: true tags: fluorine-builder:latest cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max - name: Restore ccache uses: actions/cache@v4 with: path: ~/.cache/fluorine-ccache key: ccache-${{ runner.os }}-${{ github.sha }} restore-keys: | ccache-${{ runner.os }}- - name: Build inside container run: | mkdir -p ~/.cache/fluorine-ccache docker run --rm \ -v "${{ github.workspace }}:/src:rw" \ -v "$HOME/.cache/fluorine-ccache:/ccache:rw" \ -e CCACHE_DIR=/ccache \ -w /src \ fluorine-builder:latest \ bash /src/docker/build-inner.sh - name: Collect artifacts run: | mkdir -p artifact if ls build/*.AppImage >/dev/null 2>&1; then cp build/*.AppImage artifact/ fi if [ -d build/staging ]; then tar -czf artifact/fluorine-staging.tar.gz -C build/staging . fi ls -lh artifact/ - name: Upload AppImage uses: actions/upload-artifact@v4 with: name: Fluorine-AppImage path: artifact/*.AppImage if-no-files-found: warn - name: Upload staging uses: actions/upload-artifact@v4 with: name: Fluorine-Staging path: artifact/fluorine-staging.tar.gz if-no-files-found: warn release: if: startsWith(github.ref, 'refs/tags/v') needs: build runs-on: ubuntu-latest permissions: contents: write steps: - name: Download artifacts uses: actions/download-artifact@v4 with: name: Fluorine-AppImage path: artifact/ - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: files: artifact/*.AppImage generate_release_notes: true