name: Release on: push: tags: ['v*'] permissions: contents: write jobs: release: # Arch Linux only ships x86_64 images, so pick an amd64 runner. runs-on: amd64 container: archlinux:latest steps: - name: Install dependencies run: | pacman -Syu --noconfirm --needed git nodejs curl jq - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Source tarball run: | git config --global --add safe.directory "$PWD" version="${GITHUB_REF_NAME#v}" mkdir -p dist git archive --format=tar --prefix="qtpotato-$version/" "$GITHUB_REF_NAME" \ | gzip -n > "dist/qtpotato-$version.tar.gz" - name: Publish release env: TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | cd dist sha256sum -- * > SHA256SUMS api="$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY" id=$(jq -n --arg tag "$GITHUB_REF_NAME" '{tag_name: $tag, name: ("QtPotato " + ($tag | ltrimstr("v")))}' \ | curl -fsS -X POST -H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \ --data @- "$api/releases" | jq -r .id) for f in *; do curl -fsS -X POST -H "Authorization: token $TOKEN" \ -F "attachment=@$f" "$api/releases/$id/assets?name=$f" > /dev/null done