Skip to content

Update actions/setup-python action to v4 - autoclosed #289

Update actions/setup-python action to v4 - autoclosed

Update actions/setup-python action to v4 - autoclosed #289

Workflow file for this run

name: Release
on:
pull_request:
types: closed
jobs:
tag:
name: Create Tag
runs-on: ubuntu-latest
if: github.event.pull_request.merged && (github.base_ref == 'develop' || github.base_ref == 'master')
outputs:
tag: ${{ steps.calculate.outputs.next_tag }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r tests/requirements.txt
- name: Get Latest Tag
id: latest_tag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Calculate next tag
id: calculate
run: python tests/helpers/release.py ${{ steps.latest_tag.outputs.tag }} ${{ github.event.pull_request.number }} ${{ github.base_ref }}
- name: Create Tag
id: create_tag
uses: K-Phoen/semver-release-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_branch: ${{ github.base_ref }}
release_strategy: tag
tag_format: ${{ env.TAG_FORMAT }}
tag: ${{ steps.calculate.outputs.next_tag }}
publish:
name: Publish Package
runs-on: ubuntu-latest
needs: tag
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
- name: Publish Package
run: |
chmod +x gradlew
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
ORG_GRADLE_PROJECT_CICD_TAG: ${{needs.tag.outputs.tag}}
release:
name: Create Release
runs-on: ubuntu-latest
needs: [tag, publish]
steps:
- name: Create Draft Release
uses: release-drafter/release-drafter@v5.21.1
if: github.base_ref == 'develop'
with:
tag: ${{needs.tag.outputs.tag}}
version: ${{needs.tag.outputs.tag}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: release_info
uses: release-drafter/release-drafter@v5.21.1
if: github.base_ref == 'master'
with:
tag: ${{needs.tag.outputs.tag}}
version: ${{needs.tag.outputs.tag}}
publish: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Tweet Release Info
id: tweet
if: github.base_ref == 'master'
uses: snow-actions/tweet@v1.1.1
env:
CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }}
CONSUMER_API_SECRET_KEY: ${{ secrets.TWITTER_CONSUMER_API_SECRET_KEY }}
ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
with:
status: |
Released ${{ steps.release_info.outputs.name }}
${{ steps.release_info.outputs.html_url }}
- name: Twitter response
if: github.base_ref == 'master'
run: echo ${{ steps.tweet.outputs.response }}