File tree Expand file tree Collapse file tree 4 files changed +74
-3
lines changed Expand file tree Collapse file tree 4 files changed +74
-3
lines changed Original file line number Diff line number Diff line change 1+ name : Publish to opam-repository
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+
8+ jobs :
9+ lint :
10+ runs-on : ubuntu-latest
11+ env :
12+ # allow opam depext to yes package manager prompts
13+ OPAMCONFIRMLEVEL : unsafe-yes
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v5
17+
18+ - name : Setup OCaml
19+ uses : ocaml/setup-ocaml@v3
20+ with :
21+ ocaml-compiler : " 5.3"
22+
23+ - name : Install dependencies
24+ run : opam install opam-publish
25+
26+ - name : Publish
27+ run : ./scripts/publish.sh
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ TAG=" $1 "
5+ BRANCH=" release/v$TAG "
6+
7+ if ! command -v git-cliff > /dev/null; then
8+ echo " git-cliff is not installed. Run: cargo install git-cliff"
9+ exit 1
10+ fi
11+
12+ # Fail fast if opam-publish isn't installed
13+ if ! command -v gh > /dev/null; then
14+ echo " github-clie is not installed."
15+ exit 1
16+ fi
17+
18+ git switch -c $BRANCH
19+ git-cliff -c cliff.toml -t $TAG -o CHANGES.md
20+ git add CHANGES.md
21+ git commit -m " Release $TAG "
22+ git push -u origin $BRANCH
23+
24+ gh pr create \
25+ --base " main" \
26+ --head " $BRANCH " \
27+ --title " Release $TAG " \
28+ --body " Automated Release $TAG "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ TAG=" $( git describe --tags --exact-match 2> /dev/null || true) "
5+
6+ if [ -z " $TAG " ]; then
7+ echo " No tag on the current commit. Nothing to release."
8+ exit 0
9+ fi
10+
11+ echo " Found tag $TAG on HEAD. Releasing…"
12+
13+ # Remove pin depends which are not allowed in opam-repository
14+ sed -i ' /^pin-depends:/,$d' smtml.opam
15+
16+ opam exec -- opam-publish \
17+ --tag=" $TAG " \
18+ --no-confirmation \
19+ --no-browser
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments