.github/workflows/publish-server.yml #2
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
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag to use for release' | |
required: true | |
prerelease: | |
description: 'Is this a pre-release' | |
required: true | |
default: false | |
jobs: | |
publish-opam-package: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
ocaml-compiler: [4.14.x] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Use OCaml ${{ matrix.ocaml-compiler }} | |
uses: avsm/setup-ocaml@v3 | |
with: | |
ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
- name: Install opam-publish | |
run: opam install -y -j 2 opam-publish=2.5.0 | |
- name: Inject slug/short variables | |
uses: rlespinasse/github-slug-action@v4 | |
- uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.BOT_SSH_KEY }} | |
- 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/vscoqbot.token | |
- name: Publish release on opam | |
if: ${{ !github.event.inputs.prerelease }} | |
run: | | |
eval $(opam env) | |
VERSION_SLUG="${{ github.event.inputs.tag }}" | |
VERSION="${VERSION_SLUG#v}" | |
cd language-server | |
git config --global user.name vscoqbot | |
git config --global user.email [email protected] | |
opam publish --no-confirmation --no-browser -v $VERSION https://github.com/coq/vscoq/releases/download/$VERSION_SLUG/vscoq-language-server-$VERSION.tar.gz vscoq-language-server.opam | |
- name: Publish prerelease on coq/opam | |
if: ${{ github.event.inputs.prerelease }} | |
run: | | |
eval $(opam env) | |
VERSION_SLUG="${{ github.event.inputs.tag }}" | |
VERSION="${VERSION_SLUG#v}" | |
cd language-server | |
git config --global user.name vscoqbot | |
git config --global user.email [email protected] | |
opam publish --no-confirmation --no-browser --packages-directory=extra-dev/packages --repo=coq/opam -v $VERSION https://github.com/coq/vscoq/releases/download/$VERSION_SLUG/vscoq-language-server-$VERSION.tar.gz vscoq-language-server.opam |