name: Release binary and debian package for cl-cli on: push: tags: - v** jobs: webext-build: runs-on: ubuntu-latest container: image: node:24 steps: - name: Checkout repository uses: https://github.com/actions/checkout@v4 - name: Install dependencies run: cd web-extension/cl && npm install - name: Build and sign web extension env: AMO_API_KEY: ${{ secrets.AMO_API_KEY }} AMO_API_SECRET: ${{ secrets.AMO_API_SECRET }} run: cd web-extension/cl && npm run sign - name: Upload web extension artifact uses: https://github.com/actions/upload-artifact@v3 with: name: webext-xpi path: web-extension/cl/web-ext-artifacts/*.xpi retention-days: 7 if-no-files-found: error build-and-release: runs-on: ubuntu-latest needs: [webext-build] steps: - name: Checkout repository uses: https://github.com/actions/checkout@v4 - name: Install rust toolchain uses: https://github.com/dtolnay/rust-toolchain@stable - name: Install cargo-deb run: cargo install --quiet cargo-deb - name: Build Debian package run: cargo deb --quiet - name: Upload Debian package to Gitea registry env: GITEA_OWNER: ${{ vars.PUBLISH_USERNAME }} GITEA_SERVER_URL: ${{ github.server_url }} GITEA_TOKEN: ${{ secrets.PUBLISH_TOKEN }} DEB_DISTRIBUTIONS: noble,plucky,questing DEB_COMPONENT: main DEB_ARCH: amd64 run: | set -euo pipefail DEB_FILE=$(ls target/debian/*.deb | head -n1) if [ -z "${DEB_FILE}" ]; then echo "No .deb file found in target/debian" >&2 exit 1 fi # comma-separated in DEB_DISTRIBUTIONS, e.g. "noble,plucky,questing" IFS=',' read -r -a DISTROS <<< "$DEB_DISTRIBUTIONS" for DISTRO in "${DISTROS[@]}"; do echo "Uploading ${DEB_FILE} to ${GITEA_SERVER_URL} for owner ${GITEA_OWNER}" curl -sSf -X PUT \ --user "${GITEA_OWNER}:${GITEA_TOKEN}" \ --upload-file "${DEB_FILE}" \ "${GITEA_SERVER_URL}/api/packages/${GITEA_OWNER}/debian/pool/${DISTRO}/main/upload" done - name: Download web extension artifact uses: https://github.com/actions/download-artifact@v3 with: name: webext-xpi path: web-extension/cl/web-ext-artifacts - name: Release uses: https://gitea.com/akkuman/gitea-release-action@v1 env: NODE_OPTIONS: '--experimental-fetch' # if nodejs < 18 with: files: |- config.toml.dist web-extension/cl/web-ext-artifacts/*.xpi md5sum: true sha256sum: true body: Test release prerelease: true #body_path: .changes/${{ github.ref_name }}.md