Skip to content

Commit

Permalink
ci: don't run build + release steps on commit, only on tag
Browse files Browse the repository at this point in the history
we already try building the package in the lint-test workflow, no need to do the same thing again here
  • Loading branch information
shiftinv committed Jan 3, 2024
1 parent 281b6ff commit 87719df
Showing 1 changed file with 3 additions and 14 deletions.
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 87719df

Please sign in to comment.