RELEASE #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: RELEASE | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the master branch | |
on: | |
push: | |
tags: [ "v*.*.*" ] | |
workflow_dispatch: | |
inputs: | |
opam: | |
description: "Force OPAM release" | |
required: true | |
default: false | |
type: boolean | |
suite: | |
description: "OPAM suite" | |
required: true | |
default: "released" | |
type: choice | |
options: | |
- released | |
- extra-dev | |
env: | |
OPAM_SUITE: ${{ inputs.suite }} | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Inject slug/short variables | |
uses: rlespinasse/github-slug-action@v4 | |
- name: Create archive | |
run: | | |
VERSION="${GITHUB_REF_NAME_SLUG#v}" | |
git archive -o rocq-elpi-$VERSION.tar.gz --prefix=rocq-elpi-$VERSION/ $GITHUB_SHA . | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: rocq-elpi-*.tar.gz | |
fail_on_unmatched_files: true | |
prerelease: true | |
generate_release_notes: true | |
name: Rocq-Elpi ${{ github.ref }} for Rocq XXX | |
opam: | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') || inputs.opam | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: '100' | |
fetch-tags: 'true' | |
- name: Use OCaml 4.14.x | |
uses: ocaml/setup-ocaml@v3 | |
with: | |
ocaml-compiler: 4.14.x | |
opam-local-packages: | | |
!coq-elpi.opam | |
!rocq-elpi.opam | |
- name: Write PAT | |
env: | |
OPAM_PUBLISH_TOKEN: ${{ secrets.OPAM_PUBLISH_TOKEN }} | |
run: | | |
mkdir -p ~/.opam/plugins/opam-publish | |
printf "$OPAM_PUBLISH_TOKEN" > ~/.opam/plugins/opam-publish/coqelpibot.token | |
- name: Setup SSH | |
uses: webfactory/ssh-agent@v0.8.0 | |
with: | |
ssh-private-key: ${{ secrets.BOT_SSH_KEY }} | |
- name: Install opam-publish | |
run: opam install -y -j 2 opam-publish=2.5.0 | |
- name: Publish | |
run: | | |
eval $(opam env) | |
git config --global user.name coqelpibot | |
git config --global user.email coqelpibot@inria.fr | |
echo known tags: | |
git tag | |
TAG=`git tag --sort=-v:refname|head -1` | |
echo selected tag: $TAG | |
# do not use the new name of the repo, or you get a 404 using GH APIs | |
opam-publish --no-confirmation --tag=$TAG --packages-directory=${OPAM_SUITE:-released}/packages --repo=coq/opam-coq-archive --no-browser -v ${TAG##v} rocq-elpi.opam coq-elpi.opam https://github.com/LPCIC/coq-elpi/releases/download/$TAG/rocq-elpi-${TAG##v}.tar.gz |