Skip to content

Merge pull request #159 from Ouranosinc/prepare_v0.3.0 #4

Merge pull request #159 from Ouranosinc/prepare_v0.3.0

Merge pull request #159 from Ouranosinc/prepare_v0.3.0 #4

Workflow file for this run

name: Publish Python 🐍 distributions 📦 to TestPyPI
on:
push:
tags:
- 'v*.*' # Push events to matching v*, i.e. v1.0, v20.15.10
permissions:
contents: read
jobs:
release:
name: Create Release from tag
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '.0')
permissions:
contents: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Checkout code
uses: actions/[email protected]
- name: Create Release
uses: softprops/action-gh-release@v1
env:
# This token is provided by Actions, you do not need to create your own token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
draft: true
prerelease: false
deploy-testpypi:
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
runs-on: ubuntu-latest
environment: staging
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- uses: actions/[email protected]
- name: Set up Python3
uses: actions/[email protected]
with:
python-version: "3.x"
- name: Install packaging libraries
run: |
python -m pip install flit
- name: Build a binary wheel and a source tarball
run: |
python -m flit build
- name: Publish distribution 📦 to Test PyPI
uses: pypa/[email protected]
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true