name: Build and Test on: push: branches: - main pull_request: branches: - main jobs: build: runs-on: archlinux container: image: ghcr.io/jdx/mise:2026.10.19-debian steps: - name: Checkout code uses: actions/checkout@v6 - name: Install tools run: | mise trust mise install - name: Install just run: | curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin - name: Install system dependencies run: | apt-get update apt-get install -y libglib2.0-dev glib-networking zip - name: Install project dependencies run: pnpm install --frozen-lockfile --ignore-scripts - name: Build and package extension run: just build-package - name: Upload extension package uses: actions/upload-artifact@v3 with: name: prettyborders-extension path: prettyborders.zip retention-days: 30 release: needs: build runs-on: archlinux if: github.ref == 'refs/heads/main' && github.event_name == 'push' environment: name: production container: image: ghcr.io/jdx/mise:2026.10.19-debian steps: - name: Checkout code uses: actions/checkout@v6 - name: Install tools run: | mise trust mise install - name: Download artifact uses: actions/download-artifact@v3 with: name: prettyborders-extension - name: Get version from package.json id: get_version run: | VERSION=$(node -p "require('./package.json').version") echo "version=v${VERSION}" >> $GITHUB_OUTPUT - name: Create Gitea Release env: GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} run: | curl -X POST \ -H "Authorization: token ${GITEA_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "tag_name": "${{ steps.get_version.outputs.version }}", "name": "Release ${{ steps.get_version.outputs.version }}", "body": "Automated release of prettyborders GNOME extension ${{ steps.get_version.outputs.version }}\n\n## Installation\nDownload prettyborders.zip and install it as a GNOME extension." }' \ "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases" - name: Upload Release Asset env: GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} run: | RELEASE_ID=$(curl -H "Authorization: token ${GITEA_TOKEN}" \ "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/tags/${{ steps.get_version.outputs.version }}" | \ grep -Po '"id":\s*\K[0-9]+' | head -1) curl -X POST \ -H "Authorization: token ${GITEA_TOKEN}" \ -H "Content-Type: multipart/form-data" \ -F "attachment=@prettyborders.zip" \ "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=prettyborders.zip"