Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cd: prerelease #968

Merged
merged 6 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 31 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- 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: 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
Expand All @@ -37,12 +37,39 @@ jobs:
mkdir -p ~/.opam/plugins/opam-publish
printf "$OPAM_PUBLISH_TOKEN" > ~/.opam/plugins/opam-publish/vscoqbot.token

- name: Publish
- name: Create archive
run: |
VERSION_SLUG="${GITHUB_REF_NAME_SLUG#v}"
VERSION="${GITHUB_REF_NAME#v}"
cd language-server
git archive -o vscoq-language-server-$VERSION.tar.gz --prefix=vscoq-language-server-$VERSION/ $VERSION_SLUG .

- name: Release archive
uses: softprops/action-gh-release@v1
with:
files: vscoq-language-server-*.tar.gz
fail_on_unmatched_files: true
append_body: true
gares marked this conversation as resolved.
Show resolved Hide resolved
prerelease: ${{ github.event.release.prerelease }}

- name: Publish release
if: ${{ !github.event.release.prerelease }}
run: |
eval $(opam env)
VERSION_SLUG="${GITHUB_REF_NAME_SLUG#v}"
VERSION="${GITHUB_REF_NAME#v}"
cd language-server
git config --global user.name vscoqbot
git config --global user.email vscoqbot@inria.fr
opam publish --no-confirmation --no-browser -v $VERSION https://github.com/coq/vscoq/releases/download/$GITHUB_REF_NAME/vscoq-language-server-$VERSION_SLUG.tar.gz vscoq-language-server.opam

- name: Publish prerelease
if: ${{ github.event.release.prerelease }}
run: |
eval $(opam env)
VERSION_SLUG="${GITHUB_REF_NAME_SLUG#v}"
VERSION="${GITHUB_REF_NAME#v}"
cd language-server
git config --global user.name vscoqbot
git config --global user.email vscoqbot@inria.fr
opam publish --no-browser -v $VERSION https://github.com/coq-community/vscoq/releases/download/$GITHUB_REF_NAME/vscoq-language-server-$VERSION_SLUG.tar.gz vscoq-language-server.opam
opam publish --no-confirmation --no-browser --packages-directory=extra-dev/packages --repo=coq/opam -v $VERSION https://github.com/coq/vscoq/releases/download/$GITHUB_REF_NAME/vscoq-language-server-$VERSION_SLUG.tar.gz vscoq-language-server.opam
51 changes: 42 additions & 9 deletions .github/workflows/publish-server.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
on:
on:
workflow_dispatch:
inputs:
tags:
description: 'Tag to use for release'
tag:
description: 'Tag to use for release'
required: true
default: ${GITHUB_REF_NAME#v}
prerelease:
description: 'Is this a pre-release'
required: true
default: false

jobs:

Expand All @@ -21,8 +27,8 @@ jobs:
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- 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: 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
Expand All @@ -38,12 +44,39 @@ jobs:
mkdir -p ~/.opam/plugins/opam-publish
printf "$OPAM_PUBLISH_TOKEN" > ~/.opam/plugins/opam-publish/vscoqbot.token

- name: Publish
- name: Create archive
run: |
VERSION_SLUG="${{ github.event.inputs.tag }}"
VERSION="${VERSION_SLUG#v}"
cd language-server
git archive -o vscoq-language-server-$VERSION.tar.gz --prefix=vscoq-language-server-$VERSION/ $VERSION_SLUG .

- name: Release archive
uses: softprops/action-gh-release@v1
with:
files: vscoq-language-server-*.tar.gz
fail_on_unmatched_files: true
prerelease: ${{ github.event.inputs.prerelease }}
append_body: true

- name: Publish release
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 vscoqbot@inria.fr
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
if: ${{ github.event.inputs.prerelease }}
run: |
eval $(opam env)
VERSION_SLUG="${GITHUB_REF_NAME_SLUG#v}"
VERSION="${GITHUB_REF_NAME#v}"
VERSION_SLUG="${{ github.event.inputs.tag }}"
VERSION="${VERSION_SLUG#v}"
cd language-server
git config --global user.name vscoqbot
git config --global user.email vscoqbot@inria.fr
opam publish --no-browser -v $VERSION https://github.com/coq-community/vscoq/releases/download/$GITHUB_REF_NAME/vscoq-language-server-$VERSION_SLUG.tar.gz vscoq-language-server.opam
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
Loading