Skip to content

Commit

Permalink
Configure release CD
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <[email protected]>
  • Loading branch information
LecrisUT committed Dec 4, 2023
1 parent 97bdb05 commit 8e22417
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 52 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/publish.yml

This file was deleted.

92 changes: 92 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+dev[0-9]+"
workflow_dispatch:
inputs:
skip-tests:
type: boolean
description: Skip
default: false
ref:
type: string
description: Tag to release
required: true

permissions:
contents: read

jobs:
pre-commit:
uses: ./.github/workflows/step_pre-commit.yml
if: "! inputs.skip-tests"

test-pip:
needs: [ pre-commit ]
uses: ./.github/workflows/step_tests-pip.yml
if: "! inputs.skip-tests"

test-conda:
needs: [ test-pip ]
uses: ./.github/workflows/step_tests-conda.yml
if: "! inputs.skip-tests"

test-ui:
needs: [ test-pip ]
uses: ./.github/workflows/step_tests-ui.yml
if: "! inputs.skip-tests"

test-status:
needs: [ pre-commit, test-pip, test-conda, test-ui ]
runs-on: ubuntu-latest
steps:
- uses: re-actors/alls-green@release/v1
with:
allowed-skips: pre-commit, test-pip, test-conda, test-ui
jobs: ${{ toJSON(needs) }}
if: always()

build:
needs: [ test-status ]
uses: ./.github/workflows/step_build.yml
with:
upload: true
ref: ${{ inputs.ref }}

publish:
needs: [ build ]
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/jupytext

permissions:
contents: read
id-token: write

steps:
- uses: actions/download-artifact@v3
with:
name: dist
path: dist
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1

release:
needs: [ publish ]
name: Create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- uses: softprops/action-gh-release@v1
with:
name: Jupytext ${{ inputs.ref || github.ref_name }}
draft: true
prerelease: ${{ contains(inputs.ref || github.ref, 'rc') }}
generate_release_notes: true
5 changes: 5 additions & 0 deletions .github/workflows/step_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
required: false
default: false
description: Upload build artifacts
ref:
type: string
description: Tag to build

permissions:
contents: read
Expand All @@ -19,6 +22,8 @@ jobs:
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
Expand Down

0 comments on commit 8e22417

Please sign in to comment.