-
Notifications
You must be signed in to change notification settings - Fork 74
67 lines (58 loc) · 2.16 KB
/
publish-server.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to use for release'
required: true
prerelease:
description: 'Publish as pre-release'
type: boolean
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: ${{ !inputs.prerelease }}
run: |
eval $(opam env)
VERSION_SLUG="${{ 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: ${{ inputs.prerelease }}
run: |
eval $(opam env)
VERSION_SLUG="${{ 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