-
Notifications
You must be signed in to change notification settings - Fork 52
109 lines (95 loc) · 3.29 KB
/
main.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
tags: [ "v*.*.*" ]
pull_request:
branches: [ master ]
workflow_dispatch:
inputs:
suite:
description: "Coq OPAM suite"
required: true
default: "released"
type: choice
options:
- released
- extra-dev
env:
OPAM_SUITE: ${{ inputs.suite }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
coq_version: [ '8.20+rc1' , 'dev' ]
ocaml_version:
- '4.14.x'
- '5.2.x'
steps:
- uses: actions/checkout@v2
- uses: avsm/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml_version }}
opam-pin: false
opam-local-packages:
- run: opam repo add coq-dev https://coq.inria.fr/opam/core-dev
- run: opam install coq-core.${{ matrix.coq_version }}
- run: opam install coq-stdlib.${{ matrix.coq_version }}
- run: |
opam pin add coq-core ${{ matrix.coq_version }}
opam pin add coq-stdlib ${{ matrix.coq_version }}
if: ${{ matrix.coq_version != 'dev' }}
- run: opam install ./coq-elpi.opam --deps-only --with-test -y --ignore-constraints-on coq
- run: opam exec make build
- run: opam exec make test
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
#needs: [build]
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 coq-elpi-$VERSION.tar.gz --prefix=coq-elpi-$VERSION/ $GITHUB_SHA .
- name: Release
uses: softprops/action-gh-release@v1
with:
files: coq-elpi-*.tar.gz
fail_on_unmatched_files: true
prerelease: true
generate_release_notes: true
name: Coq-Elpi ${{ github.ref }} for Coq XXX
- name: Use OCaml 4.14.x
uses: avsm/setup-ocaml@v2
with:
ocaml-compiler: 4.14.x
opam-local-packages: |
!coq-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/[email protected]
with:
ssh-private-key: ${{ secrets.BOT_SSH_KEY }}
- name: Install opam-publish # 2.0.3 because more recent versions do not respect OPAMYES
run: opam install -y -j 2 opam-publish=2.0.3
- name: Publish
run: |
eval $(opam env)
git config --global user.name coqelpibot
git config --global user.email [email protected]
TAG=`git tag --sort=-v:refname|head -1`
opam-publish --tag=$TAG --packages-directory=${OPAM_SUITE:-released}/packages --repo=coq/opam --no-browser -v ${TAG##v} coq-elpi.opam https://github.com/LPCIC/coq-elpi/releases/download/$TAG/coq-elpi-${TAG##v}.tar.gz