Test release CI within PR #10
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: publish-and-release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
release: | ||
required: true | ||
description: "Release tag (e.g. 3.2.1)" | ||
release-again: | ||
required: true | ||
description: "Just checking." | ||
pull_request: # for iteractive fixing CI errors with a PR (without having to push to master to see them) | ||
env: | ||
# NEW_VERSION: {{ github.event.input.release }} | ||
# NEW_VERSION2: {{ github.event.input.release-again }} | ||
NEW_VERSION: 3.2.5 | ||
NEW_VERSION2: 3.2.5 | ||
jobs: | ||
build-and-commit: | ||
name: "Build dist and create release commit" | ||
runs-on: ubuntu-latest | ||
if: env.NEW_VERSION | ||
Check failure on line 24 in .github/workflows/release.yml GitHub Actions / publish-and-releaseInvalid workflow file
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8" | ||
- name: "1. Prepare build/release environemnt" | ||
run: | | ||
pip install --user python-minifier wheel setuptools git-changelog | ||
git config user.name github-actions | ||
git config user.email github-actions@github.com | ||
- name: "2. Bump version-files and update changelog" | ||
run: | | ||
.github/scripts/bump-and-update.changelog.sh $NEW_VERSION | ||
git diff # check changes | ||
- name: "3. Build and Check distribution" | ||
run: | | ||
make dist | ||
.github/scripts/dist-health-check.sh | ||
- name: "4. Save dist for publishing" | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist-folder | ||
path: dist | ||
if-no-files-found: "error" | ||
- name: "5. Create release-commit" | ||
run: | | ||
# .github/scripts/create-release-commit.sh {{ github.event.input.release}} | ||
.github/scripts/create-release-commit.sh $NEW_VERSION | ||
- name: "6. Push commit to master" | ||
run: | | ||
echo "Pushing commit to master" | ||
git log --oneline -5 | ||
git show HEAD | ||
pypi-publish: | ||
name: "Upload release to PyPI" | ||
needs: build-and-commit | ||
runs-on: ubuntu-latest | ||
# environment: | ||
# name: pypi | ||
# url: https://pypi.org/p/dynaconf | ||
# permissions: | ||
# id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | ||
steps: | ||
- name: Get distribution | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dist-folder | ||
path: dist | ||
- name: Test publish | ||
run: | | ||
tree dist | ||
# - name: Publish package distributions to PyPI | ||
# uses: pypa/gh-action-pypi-publish@release/v1 | ||
github-release: | ||
name: Create GitHub Release | ||
needs: pypi-publish | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
- name: Install git-changelog | ||
run: pip install git-changelog | ||
- name: Prepare release notes | ||
run: | | ||
git-changelog --release-notes > release-notes.md | ||
echo "Release notes being used:" | ||
cat release-notes.md | ||
# - name: Create GitHub release | ||
# uses: softprops/action-gh-release@v1 | ||
# with: | ||
# body_path: release-notes.md |