-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transplant workflows from python-starlark-go (#174)
* Transplant workflows from python-starlark-go * Deal with not being src layout * Try harder to cope with not being src layout * No Go in this repo * Make linter happy
- Loading branch information
Showing
9 changed files
with
254 additions
and
174 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
name: Build wheels | ||
|
||
on: | ||
pull_request: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
jobs: | ||
# Build the source distribution for PyPI | ||
build_sdist: | ||
name: Build sdist | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Build sdist | ||
run: | | ||
python3.10 -m pip install --upgrade wheel | ||
python3.10 setup.py sdist | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: dist/*.tar.gz | ||
|
||
# Build binary distributions for PyPI | ||
build_wheels: | ||
name: Build ${{ matrix.build }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Windows isn't working right now: https://github.com/caketop/python-starlark-go/issues/4 | ||
# os: [ubuntu-latest, windows-latest, macos-latest] | ||
os: [ubuntu-latest] | ||
build: [cp311, cp310, cp39, cp38, cp37, cp36] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-go@v3 | ||
if: runner.os != 'Linux' | ||
|
||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/[email protected] | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: ${{ matrix.build }}-* | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: wheelhouse/starlark_go-*.whl | ||
|
||
# Create a GitHub release | ||
github_release: | ||
name: Create GitHub release | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- name: "✏️ Generate release changelog" | ||
id: changelog | ||
uses: heinrichreimer/[email protected] | ||
with: | ||
filterByMilestone: false | ||
onlyLastTag: true | ||
pullRequests: true | ||
prWoLabels: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
verbose: true | ||
|
||
- name: Create GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body: ${{ steps.changelog.outputs.changelog }} | ||
files: dist/**/* | ||
|
||
# Test PyPI | ||
test_pypi_publish: | ||
name: Test publishing to PyPI | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
skip_existing: true | ||
|
||
# Publish to PyPI | ||
pypi_publish: | ||
name: Publish to PyPI | ||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') | ||
needs: [build_wheels, build_sdist] | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Bump version | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: | ||
- labeled | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Bump version on merging Pull Requests with specific labels. | ||
# (bump:major,bump:minor,bump:patch) | ||
- uses: haya14busa/action-bumpr@v1 | ||
with: | ||
github_token: ${{ secrets.BUMPR_TOKEN }} |
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
Oops, something went wrong.