| 1 |
|
| 2 |
|
| 3 |
name: RELEASE |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
on: |
| 8 |
push: |
| 9 |
tags: [ "v*.*.*" ] |
| 10 |
workflow_dispatch: |
| 11 |
inputs: |
| 12 |
opam: |
| 13 |
description: "Force OPAM release" |
| 14 |
required: true |
| 15 |
default: false |
| 16 |
type: boolean |
| 17 |
suite: |
| 18 |
description: "OPAM suite" |
| 19 |
required: true |
| 20 |
default: "released" |
| 21 |
type: choice |
| 22 |
options: |
| 23 |
- released |
| 24 |
- extra-dev |
| 25 |
|
| 26 |
env: |
| 27 |
OPAM_SUITE: ${{ inputs.suite }} |
| 28 |
|
| 29 |
jobs: |
| 30 |
|
| 31 |
release: |
| 32 |
runs-on: ubuntu-latest |
| 33 |
if: startsWith(github.ref, 'refs/tags/') |
| 34 |
steps: |
| 35 |
- name: Checkout |
| 36 |
uses: actions/checkout@v4 |
| 37 |
|
| 38 |
- name: Inject slug/short variables |
| 39 |
uses: rlespinasse/github-slug-action@v4 |
| 40 |
|
| 41 |
- name: Create archive |
| 42 |
run: | |
| 43 |
VERSION="${GITHUB_REF_NAME_SLUG#v}" |
| 44 |
git archive -o rocq-elpi-$VERSION.tar.gz --prefix=rocq-elpi-$VERSION/ $GITHUB_SHA . |
| 45 |
|
| 46 |
- name: Release |
| 47 |
uses: softprops/action-gh-release@v1 |
| 48 |
with: |
| 49 |
files: rocq-elpi-*.tar.gz |
| 50 |
fail_on_unmatched_files: true |
| 51 |
prerelease: true |
| 52 |
generate_release_notes: true |
| 53 |
name: Rocq-Elpi ${{ github.ref }} for Rocq XXX |
| 54 |
|
| 55 |
opam: |
| 56 |
runs-on: ubuntu-latest |
| 57 |
if: startsWith(github.ref, 'refs/tags/') || inputs.opam |
| 58 |
steps: |
| 59 |
- name: Checkout |
| 60 |
uses: actions/checkout@v4 |
| 61 |
with: |
| 62 |
fetch-depth: 0 |
| 63 |
|
| 64 |
- name: Use OCaml 4.14.x |
| 65 |
uses: ocaml/setup-ocaml@v3 |
| 66 |
with: |
| 67 |
ocaml-compiler: 4.14.x |
| 68 |
opam-local-packages: | |
| 69 |
!coq-elpi.opam |
| 70 |
!rocq-elpi.opam |
| 71 |
!rocq-elpi-json.opam |
| 72 |
|
| 73 |
- name: Write PAT |
| 74 |
env: |
| 75 |
OPAM_PUBLISH_TOKEN: ${{ secrets.OPAM_PUBLISH_TOKEN }} |
| 76 |
run: | |
| 77 |
mkdir -p ~/.opam/plugins/opam-publish |
| 78 |
printf "$OPAM_PUBLISH_TOKEN" > ~/.opam/plugins/opam-publish/coqelpibot.token |
| 79 |
|
| 80 |
- name: Setup SSH |
| 81 |
uses: webfactory/[email protected] |
| 82 |
with: |
| 83 |
ssh-private-key: ${{ secrets.BOT_SSH_KEY }} |
| 84 |
|
| 85 |
- name: Install opam-publish |
| 86 |
run: opam install -y -j 2 opam-publish=2.5.0 |
| 87 |
|
| 88 |
- name: Publish |
| 89 |
run: | |
| 90 |
eval $(opam env) |
| 91 |
git config --global user.name coqelpibot |
| 92 |
git config --global user.email [email protected] |
| 93 |
echo known tags: |
| 94 |
git tag |
| 95 |
TAG=`git tag --sort=-v:refname|head -1` |
| 96 |
echo selected tag: $TAG |
| 97 |
# do not use the new name of the repo, or you get a 404 using GH APIs |
| 98 |
GITHUB_DEBUG=1 opam-publish --no-confirmation --tag=$TAG \ |
| 99 |
--packages-directory=${OPAM_SUITE:-released}/packages \ |
| 100 |
--repo=rocq-prover/opam --no-browser -v ${TAG##v} \ |
| 101 |
rocq-elpi.opam rocq-elpi-json.opam rocq-elpi-xml.opam \ |
| 102 |
coq-elpi.opam \ |
| 103 |
https://github.com/LPCIC/coq-elpi/releases/download/$TAG/rocq-elpi-${TAG##v}.tar.gz |