Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
thomass-dev committed Oct 4, 2024
1 parent 7efa77a commit f3709ed
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
name: Release

on:
release:
types: [released, prereleased]
# on:
# release:
# types: [released, prereleased]

on: [push]

jobs:
tag-restriction:
name: Tag must match semantic versioning pattern
runs-on: ubuntu-latest
environment: release
steps:
- shell: bash
run: |
if ! [[ "${GITHUB_REF_NAME}" =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-rc\.(1|[1-9][0-9]*))?$ ]]; then
exit -1
fi
# tag-restriction:
# name: Tag must match semantic versioning pattern
# runs-on: ubuntu-latest
# environment: release
# steps:
# - shell: bash
# run: |
# if ! [[ "${GITHUB_REF_NAME}" =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-rc\.(1|[1-9][0-9]*))?$ ]]; then
# exit -1
# fi

build:
name: Build package distributions
runs-on: ubuntu-latest
environment: release
# environment: release
permissions:
contents: read
needs: tag-restriction
Expand All @@ -30,18 +32,21 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
# cache

- name: Build skore-ui and share library
shell: bash
run: make build-skore-ui

- name: Override VERSION.txt with tag
run: echo "${GITHUB_REF_NAME}" > skore/VERSION.txt
# run: echo "${GITHUB_REF_NAME}" > skore/VERSION.txt
run: echo "0.0.0-rc.0" > skore/VERSION.txt

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
# cache

- name: Build package distributions
run: |
Expand All @@ -65,7 +70,7 @@ jobs:
publish:
name: Publish package distributions to TestPyPI using trusted publisher
runs-on: ubuntu-latest
environment: release
# environment: release
permissions:
id-token: write
needs: build
Expand All @@ -76,15 +81,16 @@ jobs:
name: python-package-distributions
path: dist/

- name: Publish package distributions to TestPyPI
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verify-metadata: false
repository-url: https://test.pypi.org/legacy/

clean:
name: Delete package distributions artifacts
runs-on: ubuntu-latest
environment: release
# environment: release
if: always()
needs: publish
steps:
Expand Down

0 comments on commit f3709ed

Please sign in to comment.