diff options
| author | Romain GARBAGE <romain.garbage@inria.fr> | 2026-03-25 14:48:57 +0100 |
|---|---|---|
| committer | Romain GARBAGE <romain.garbage@inria.fr> | 2026-05-05 11:25:53 +0200 |
| commit | 4f29b99ce090ed2992d5bc6f3af42180201f5058 (patch) | |
| tree | 4f8a18d326d4075c935a3a17261b4aba885e2c4d /.forgejo | |
| parent | f63f00030cc789bb4c90af704dea7ad41e2c38d7 (diff) | |
Document the release process.
* documentation/release.md: New file.
* etc/tag-release.sh: New file.
* .forgejo/workflows/publish-release.yml: New file.
Diffstat (limited to '.forgejo')
| -rw-r--r-- | .forgejo/workflows/publish-release.yml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/.forgejo/workflows/publish-release.yml b/.forgejo/workflows/publish-release.yml new file mode 100644 index 0000000..5a7dcd6 --- /dev/null +++ b/.forgejo/workflows/publish-release.yml | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | on: | ||
| 2 | push: | ||
| 3 | tags: ['v*'] | ||
| 4 | |||
| 5 | jobs: | ||
| 6 | publish-release: | ||
| 7 | name: Publishes the `channels.scm` file for a Guix-Science release. | ||
| 8 | runs-on: guix | ||
| 9 | steps: | ||
| 10 | - run: | | ||
| 11 | set -e | ||
| 12 | set -x | ||
| 13 | set -o pipefail | ||
| 14 | TAG=$GITHUB_REF_NAME | ||
| 15 | # Clone full repository to get all tags (shallow cloning would skip some tags). | ||
| 16 | guix shell git-minimal nss-certs -CN -- git clone --tags $GITHUB_SERVER_URL/$GITHUB_REPOSITORY repo | ||
| 17 | cd repo | ||
| 18 | # Extract the 'channels.scm' contents from the tag's message (filtering out the header and the signature). | ||
| 19 | guix shell git-minimal -C -- git show $TAG --format=%N --no-patch | tail -n +4 | head -n -15 > channels.scm | ||
| 20 | # Create a release using the API, JSON data is stored in a file to prevent issues with mixing quotes | ||
| 21 | echo "{\"tag_name\": \"$TAG\", \"hide_archive_links\": true}" > json-data | ||
| 22 | RELEASE_ID=$(guix shell -CN curl nss-certs -- curl -H 'Content-Type: application/json' -d @json-data "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases?token=${{ secrets.TOKEN }}" | guix shell -C jq -- jq -r '.id') | ||
| 23 | # Add the channels file to the release | ||
| 24 | # TODO: verify request status. | ||
| 25 | guix shell -CN curl nss-certs -- curl -H 'accept: application/json' -H 'Content-Type: multipart/form-data' -F 'attachment=@channels.scm' --request POST "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID/assets?name=channels.scm&token=${{ secrets.TOKEN }}" \ No newline at end of file | ||
