Skip to content

Commit

Permalink
workflow: Refactor release pipelines, use PyPi trusted publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
alcarney committed Oct 7, 2023
1 parent d72c0aa commit a4e312f
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 227 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/lsp-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: 'Release: esbonio'
on:
push:
branches:
- release
paths:
- 'lib/esbonio/**'

jobs:
release:
name: esbonio release
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/esbonio
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- run: |
sudo apt update
sudo apt install pandoc
python --version
python -m pip install --upgrade pip
python -m pip install --upgrade tox bump2version towncrier docutils
name: Setup Environment
- run: |
set -e
./scripts/make-release.sh lsp
name: Set Version
id: info
- name: Package
run: |
cd lib/esbonio
python -m tox -e pkg
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: 'dist'
path: lib/esbonio/dist

- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: lib/esbonio/dist/

- name: Create Release
run: |
gh release create "${RELEASE_TAG}" \
--title "Esbonio Language Server v${VERSION} - ${RELEASE_DATE}" \
-F lib/esbonio/.changes.html \
./lib/esbonio/dist/*
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
225 changes: 0 additions & 225 deletions .github/workflows/release.yml

This file was deleted.

66 changes: 66 additions & 0 deletions .github/workflows/sphinx-ext-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: 'Release: esbonio-extensions'
on:
push:
branches:
- release
paths:
- 'lib/esbonio-extensions/**'

jobs:
release:
name: "esbonio-extensions release"
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/esbonio-extensions
permissions:
contents: write
id-token: write

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.10"

- run: |
sudo apt update
sudo apt install pandoc
python --version
python -m pip install --upgrade pip
python -m pip install --upgrade tox bump2version towncrier docutils
name: Setup Environment
- run: |
set -e
./scripts/make-release.sh extensions
name: Set Version
id: info
- name: Package
run: |
cd lib/esbonio-extensions
python -m tox -e pkg
- name: 'Upload Artifact'
uses: actions/upload-artifact@v3
with:
name: 'dist'
path: lib/esbonio-extensions/dist

- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: lib/esbonio-extensions/dist/

- name: Create Release
run: |
gh release create "${RELEASE_TAG}" \
--title "Esbonio Extensions v${VERSION} - ${RELEASE_DATE}" \
-F lib/esbonio-extensions/.changes.html \
./lib/esbonio-extensions/dist/*
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit a4e312f

Please sign in to comment.