Skip to content

Bump actions/upload-artifact from 3 to 4 #60

Bump actions/upload-artifact from 3 to 4

Bump actions/upload-artifact from 3 to 4 #60

Workflow file for this run

---
name: Create packages and release
on:
pull_request:
types:
- closed
permissions:
contents: write
jobs:
prepare-release:
name: Prepare Release
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
outputs:
version: ${{ steps.extract-version.outputs.version }}
changelog: ${{ steps.extract-changelog.outputs.markdown }}
steps:
- uses: actions/checkout@v4
- name: Extract version
id: extract-version
run: |
# this uses GNU sed -z!
version=$(grep "^## \[[0-9].*\]" CHANGELOG | \
head -1 | sed -e "s/^.*\[\(.*\)\].*/\1/")
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Extract changelog
id: extract-changelog
uses: sean0x42/markdown-extract@v2
with:
file: CHANGELOG
pattern: ${{ steps.extract-version.outputs.version }}
no-print-matched-heading: true
sdist:
name: build python sdist
needs: prepare-release
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
- name: Build sdist
run: |
pip install tox
python setup.py sdist
- name: Get version
id: version
run: echo "version=$(python setup.py --version)" >> "$GITHUB_OUTPUT"
- name: Upload output file
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*tar.gz
release:
needs: [sdist, prepare-release]
name: Upload release artefacts
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4.1.8
with:
name: sdist
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.prepare-release.outputs.version }}
name: Release ${{ needs.prepare-release.outputs.version }}
body: "${{ needs.prepare-release.outputs.changelog }}"
files: |
cloud_info_provider-${{ needs.sdist.outputs.version }}.tar.gz