Merge pull request #203 from akabe/feature/upgrade-gha #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: Build Artifacts | |
runs-on: ubuntu-latest | |
env: | |
OCAML_VERSION: 4.13.0 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get the version | |
id: version | |
run: | | |
echo "VERSION=$(echo ${{ github.ref }} | sed -e 's#refs/tags/v##g')" >> $GITHUB_ENV | |
- name: Setup OCaml | |
uses: ocaml/setup-ocaml@master | |
with: | |
ocaml-compiler: ${{ env.OCAML_VERSION }} | |
cache-prefix: opam-${{ env.OCAML_VERSION }} | |
- name: Install Dependencies | |
run: opam install dune-release | |
- name: Archive ocaml-jupyter | |
run: | | |
opam exec -- dune-release distrib --skip-build --pkg-version=${{ env.VERSION }} || : | |
ls ./_build/jupyter-${{ env.VERSION }}.tbz | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: upload | |
path: ./_build/jupyter-${{ env.VERSION }}.tbz | |
deploy: | |
name: Deploy | |
needs: [build] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Get the version | |
id: version | |
run: | | |
echo "VERSION=$(echo ${{ github.ref }} | sed -e 's#refs/tags/v##g')" >> $GITHUB_ENV | |
- name: Download Artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
path: artifacts | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: "v${{ env.VERSION }}" | |
name: "${{ env.VERSION }}" | |
draft: true | |
prerelease: false | |
files: | | |
artifacts/upload/* | |
body: | | |
## Breaking changes | |
## Minor changes | |
## Micro changes |