Skip to content

Commit

Permalink
Release workflow (#827)
Browse files Browse the repository at this point in the history
* Release workflow

This PR adds a release workflow that build an artefact with
dune-release.

The workflow runs only on branch `v*.*.x`.

Should be tested on the branch `v2.5.x`.

* Replace make_release by the Release workflow

* Test the workflow on this PR

* Trigger the workflow

* Trigger the workflow

* Use the prelease of opam

We use the new flag `allow-prelease-opam` of the GitHub action
`setup-ocaml` to use the prelease version `2.2` of opam.

* Use the latest tag on the branch in the tarball

* Try to fetch tags with the GitHub action `checkout`

By default, this GitHub action doesn't retrieve the tags of the current
branch but we need to get these tags for `dune-release`.

* Use the current commit for the name of the artefact

* Run the release workflow only on `v*.*.*` branches

* Use workflow_dispatch

* Use OCaml 4.14.1 for the release workflow
  • Loading branch information
Halbaroth authored Dec 6, 2023
1 parent c1ccd0e commit e777ee2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 25 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,28 +81,3 @@ jobs:
uses: getsentry/action-git-diff-suggestions@main
with:
message: 'The following changes have been made after `make`:'

make_release:
name: Make package release
runs-on: ubuntu-latest

if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next'

steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Use OCaml ${{ env.OCAML_DEFAULT_VERSION }}
uses: ocaml/setup-ocaml@v2
with:
allow-prerelease-opam: true
ocaml-compiler: ${{ env.OCAML_DEFAULT_VERSION }}
dune-cache: true

- name: Install dependencies
run: opam exec -- make deps

- name: Run make install
run: opam exec -- make install
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Release

on:
workflow_dispatch

env:
OCAML_DEFAULT_VERSION: 4.14.1
OPAMYES: true

jobs:
dune_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
fetch-tags: true

- name: Use OCaml ${{ env.OCAML_DEFAULT_VERSION }}
uses: ocaml/setup-ocaml@v2
with:
allow-prerelease-opam: true
ocaml-compiler: ${{ env.OCAML_DEFAULT_VERSION }}
dune-cache: true

- name: Install dependencies
run: opam exec -- make deps

- name: Install dune-release
run: opam install dune-release

- name: Build the distribution archive
run: opam exec -- dune-release distrib

- name: Upload the artefact
uses: actions/upload-artifact@v3
with:
name: alt-ergo-${{github.sha}}.tbz
path: _build/alt-ergo-*.tbz

0 comments on commit e777ee2

Please sign in to comment.