From 804027df6242359d31f4052228f69bf5865f6067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20D=C3=A9n=C3=A8s?= Date: Fri, 18 Aug 2023 17:54:08 +0200 Subject: [PATCH] Fix OPAM package publication --- .github/workflows/cd.yml | 19 ++++++++++++++++--- .github/workflows/ci.yml | 2 +- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index ea284397..5d1ab08a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -57,10 +57,23 @@ jobs: - name: Inject slug/short variables uses: rlespinasse/github-slug-action@v4 + - uses: webfactory/ssh-agent@v0.8.0 + 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 run: | eval $(opam env) - VERSION_SLUG="${GITHUB_REF_SLUG#v}" - VERSION="${GITHUB_REF#v}" + VERSION_SLUG="${GITHUB_REF_NAME_SLUG#v}" + VERSION="${GITHUB_REF_NAME#v}" cd language-server - opam publish --no-browser --repo=coq/opam-coq-archive --packages-directory=extra-dev/packages -v $VERSION https://github.com/coq-community/vscoq/releases/download/$GITHUB_REF/vscoq-language-server-$VERSION_SLUG.tar.gz vscoq-language-server.opam + git config --global user.name vscoqbot + git config --global user.email vscoqbot@inria.fr + opam publish --no-browser --repo=coq/opam-coq-archive --packages-directory=extra-dev/packages -v $VERSION https://github.com/coq-community/vscoq/releases/download/$GITHUB_REF_NAME/vscoq-language-server-$VERSION_SLUG.tar.gz vscoq-language-server.opam diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c1973235..4e7accbd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -171,7 +171,7 @@ jobs: - name: Create language-server archive run: | cd language-server - VERSION="${GITHUB_REF_SLUG#v}" + VERSION="${GITHUB_REF_NAME_SLUG#v}" git archive -o ../vscoq-language-server-$VERSION.tar.gz --prefix=vscoq-language-server-$VERSION/ $GITHUB_SHA . - name: Release