Skip to content

Commit

Permalink
Merge pull request #979 from coq/fix-cd-pipeline
Browse files Browse the repository at this point in the history
Fix cd pipeline
  • Loading branch information
rtetley authored Jan 15, 2025
2 parents ae65f8a + c2a4015 commit 1bf53e5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 36 deletions.
19 changes: 2 additions & 17 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,7 @@ jobs:
mkdir -p ~/.opam/plugins/opam-publish
printf "$OPAM_PUBLISH_TOKEN" > ~/.opam/plugins/opam-publish/vscoqbot.token
- 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
prerelease: ${{ github.event.release.prerelease }}

- name: Publish release
- name: Publish release on opam
if: ${{ !github.event.release.prerelease }}
run: |
eval $(opam env)
Expand All @@ -63,7 +48,7 @@ jobs:
git config --global user.email [email protected]
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
- name: Publish prerelease on coq/opam
if: ${{ github.event.release.prerelease }}
run: |
eval $(opam env)
Expand Down
20 changes: 2 additions & 18 deletions .github/workflows/publish-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
tag:
description: 'Tag to use for release'
required: true
default: ${GITHUB_REF_NAME#v}
prerelease:
description: 'Is this a pre-release'
required: true
Expand Down Expand Up @@ -44,22 +43,7 @@ jobs:
mkdir -p ~/.opam/plugins/opam-publish
printf "$OPAM_PUBLISH_TOKEN" > ~/.opam/plugins/opam-publish/vscoqbot.token
- 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
- name: Publish release on opam
if: ${{ !github.event.inputs.prerelease }}
run: |
eval $(opam env)
Expand All @@ -70,7 +54,7 @@ jobs:
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
- name: Publish prerelease on coq/opam
if: ${{ github.event.inputs.prerelease }}
run: |
eval $(opam env)
Expand Down
16 changes: 15 additions & 1 deletion docs/developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,21 @@ To release a new version of VsCoq:
git push origin #VERSION_NUMBER
```

Version semantics are currently as follows: v#NUMBER+coq#COQ_VERSION (ex: v1.9.2+coq.8.18)
~~Version semantics are currently as follows: v#NUMBER+coq#COQ_VERSION (ex: v1.9.2+coq.8.18)~~
Since we now use opt comp and support all coq versions, version semantics are v2.#.# (ex: v2.2.2)

Once the CI has run, a draft release will be automatically created. Open the draft release and edit the change log to your liking.
Finally, light a candle, do a little prayer and click release !

After the opam package has been published (PR merged by opam maintainers), the user should then use ```publish-extension.yml``` to publish the extensions on the vscode marketplace as well as vscodium.

# CI/CD pipeline for release process

The CI pipeline (```ci.yml```) handles creating the draft release (with a tarball archive) when a tag is pushed. This is done in the ```create-release``` job.

The CD pipeline (```cd.yml```) automatically publishes the release to opam once the draft is released. Don't forget to fill out the change log
appropriately before hitting release. If it is a pre-release, the pipeline will publish to ```coq/opam``` instead of ```opam/opam-repository```.

There are two manual pipelines:
- ```publish-server.yml``` allows to publish a release on opam manually (if the automatic pipeline goes wrong). The user only need to give the tag (with the correct version semantics) and specify if it is a release or pre-release.
- ```publish-extension.yml``` handles publishing the extension on the vscode market place as well as vscodium. **This is always done manually because the opam release process might take some time. The extensions should only be published once the package is on opam.**

0 comments on commit 1bf53e5

Please sign in to comment.