Skip to content

Commit

Permalink
ci: skip unnecessary release workflow run (#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftinv authored Jan 3, 2024
1 parent 281b6ff commit a5c1a8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,12 @@ jobs:
- name: Try building package
run: |
pdm install -dG build
pdm run python -m build
ls -la dist/
pdm run twine check --strict dist/*
# run the libcst parsers and check for changes
- name: libcst codemod
run: |
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
# SPDX-License-Identifier: MIT

name: Build (+ Release)
name: Release

# test build for commit/tag, but only upload release for tags
on:
push:
branches:
- "master"
- 'v[0-9]+.[0-9]+.x' # matches to backport branches, e.g. v3.6.x
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

permissions:
contents: read

jobs:
# Builds sdist and wheel, runs `twine check`, and optionally uploads artifacts.
# Builds sdist and wheel, runs `twine check`, and uploads artifacts.
build:
name: Build package
runs-on: ubuntu-latest
Expand Down Expand Up @@ -50,22 +46,17 @@ jobs:
echo -e "\n</details>\n" >> $GITHUB_STEP_SUMMARY
- name: Upload artifact
# only upload artifacts when necessary
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v3
with:
name: dist
path: dist/
if-no-files-found: error


### Anything below this only runs for tags ###

# Ensures that git tag and built version match.
validate-tag:
name: Validate tag
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
env:
Expand Down Expand Up @@ -109,7 +100,6 @@ jobs:
release-github:
name: Create GitHub draft release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
- validate-tag
Expand Down Expand Up @@ -150,7 +140,6 @@ jobs:
name: release-pypi
url: https://pypi.org/project/disnake/
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- build
- validate-tag
Expand All @@ -174,7 +163,7 @@ jobs:
create-dev-version-pr:
name: Create dev version bump PR
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') && needs.validate-tag.outputs.bump_dev
if: needs.validate-tag.outputs.bump_dev
needs:
- validate-tag
- release-github
Expand Down

0 comments on commit a5c1a8f

Please sign in to comment.