Copied from the corresponding Wine script.
From: Alexandre Julliard julliard@winehq.org
Copied from the corresponding Wine script. --- .gitlab-ci.yml | 2 ++ gitlab/release.yml | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 gitlab/release.yml
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8cc59d764..af96c523a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,9 @@ stages: - image - build + - deploy
include: - local: "/gitlab/image.yml" - local: "/gitlab/build.yml" + - local: "/gitlab/release.yml" diff --git a/gitlab/release.yml b/gitlab/release.yml new file mode 100644 index 000000000..1de5cc55a --- /dev/null +++ b/gitlab/release.yml @@ -0,0 +1,20 @@ +# CI script for creating releases + +create-release: + stage: deploy + image: registry.gitlab.com/gitlab-org/release-cli:latest + rules: + - if: $CI_COMMIT_TAG && $CI_PROJECT_PATH == "wine/vkd3d" + script: + - VERSION=$(expr "$CI_COMMIT_TAG" ":" 'vkd3d-(.*)') + - URL=$(grep -o "https://dl.winehq.org/.*" ANNOUNCE) + - FILEPATH=$(expr "$URL" ":" '.*(/.*)') + - | + sed -e '/^The source/,/^----------/d + /^----------/,$d + s/^***/###/' ANNOUNCE >announce.md + - release-cli create + --name "vkd3d $VERSION" + --tag-name "$CI_COMMIT_TAG" + --description announce.md + --assets-link "{"name":"Source code","url":"$URL","link_type":"other","filepath":"$FILEPATH"}"
Giovanni Mascellani (@giomasce) commented about gitlab/release.yml:
+# CI script for creating releases
+create-release:
- stage: deploy
- image: registry.gitlab.com/gitlab-org/release-cli:latest
- rules:
- if: $CI_COMMIT_TAG && $CI_PROJECT_PATH == "wine/vkd3d"
- script:
- VERSION=$(expr "$CI_COMMIT_TAG" ":" 'vkd3d-(.*)')
- URL=$(grep -o "https://dl.winehq.org/.*" ANNOUNCE)
- FILEPATH=$(expr "$URL" ":" '.*(/.*)')
- |
sed -e '/^The source/,/^----------/d
/^----------/,$d
s/^\*\*\*/###/' ANNOUNCE >announce.md
That's very hacky, but I guess it's worth it to have nicely formatted release notes on GitLab. One improvement, though: apparently the syntax `` `word' `` is used for what in Markdown is `` `word` ``. Would it be possible to convert that? Current release notes looks a bit messy because of that.
One improvement, though: apparently the syntax `` `word' `` is used for what in Markdown is `` `word` ``.
Well, not quite, it's supposed to be more like ‘word’.
If we're willing to use pandoc, the following produces something that I think is fairly reasonable:
```bash sed ' /^[=-]+$/d s/`/'''/g /^The source is available/i#+BEGIN_COMMENT /^Vkd3d is available thanks to/i#+END_COMMENT s/^What'''s new in vkd3d/* &/g ' ANNOUNCE \ | pandoc -f org -t commonmark \ <(printf "#+OPTIONS: ^:{}\n#+OPTIONS: ':t\n#+OPTIONS: -:nil\n") - \ >announce.md ```
In principle it could produce HTML for the proper website as well, with "-t html".