Skip to content

Commit

Permalink
release ci job
Browse files Browse the repository at this point in the history
  • Loading branch information
gares committed Sep 20, 2023
1 parent 6020e05 commit d61dd8c
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ name: docker CI
on:
push:
branches: [ master ]
tags: [ "v*.*.*" ]
pull_request:
branches: [ master ]

Expand Down Expand Up @@ -62,3 +63,60 @@ jobs:
./coq.hb reset `find . -name \*.v`
mv _CoqProject.test-suite.bak _CoqProject.test-suite
git diff --exit-code
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [opam]
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 hierarchy-builder-$VERSION.tar.gz --prefix=hierarchy-builder-$VERSION/ $GITHUB_SHA .
- name: Release
uses: softprops/action-gh-release@v1
with:
files: hierarchy-builder-*.tar.gz
fail_on_unmatched_files: true
prerelease: true
generate_release_notes: true
name: Hierarchy Builder ${{ github.ref }}

- name: Use OCaml 4.14.x
uses: avsm/setup-ocaml@v2
with:
ocaml-compiler: 4.14.x
opam-local-packages: |
!coq-hierarchy-builder*.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]
OPAM_SUITE=released
TAG=`git tag --sort=-v:refname|head -1`
opam-publish --tag=$TAG --packages-directory=$OPAM_SUITE/packages --repo=coq/opam --no-browser -v ${TAG##v} https://github.com/math-comp/hierarchy-builder/releases/download/$TAG/hierarchy-builder-${TAG##v}.tar.gz

0 comments on commit d61dd8c

Please sign in to comment.