Convert the main readme into an rst file to correctly render the device support table in GitHub #77
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Package Build & Upload | |
on: | |
push: | |
branches: [main] | |
tags: ['*'] | |
pull_request: | |
branches: [main] | |
release: | |
types: [published] | |
permissions: | |
contents: read | |
id-token: write | |
# Cancel running jobs for the same workflow and branch. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
# Verify the package builds fine | |
build-package: | |
name: Build package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: hynek/[email protected] | |
# Upload to Test PyPI on every push to main | |
test-pypi: | |
name: Publish package to test.pypi.org | |
if: github.repository == 'tektronix/tm_devices' && github.event_name == 'push' | |
&& github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: build-package | |
steps: | |
- name: Download built package | |
uses: actions/download-artifact@v3 | |
with: | |
name: Packages | |
path: dist | |
- name: Upload package to Test PyPI | |
uses: pypa/[email protected] | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
# Upload to PyPI and create a tag in the repo after a GitHub Release is published | |
pypi: | |
name: Publish released package to pypi.org and create new tag in repo | |
if: github.repository == 'tektronix/tm_devices' && github.event_name == 'release' | |
&& github.event.action == 'published' | |
runs-on: ubuntu-latest | |
needs: build-package | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download built package | |
uses: actions/download-artifact@v3 | |
with: | |
name: Packages | |
path: dist | |
- name: Upload package to PyPI | |
uses: pypa/[email protected] | |
- name: Create and push tag | |
run: |- | |
git tag --annotate v${{ github.event.release.tag_name }} --message="${{ github.event.release.name }}" | |
git push --tags |