Publish v1.1.0 (#2) #3
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' | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
checks: write | |
contents: write | |
jobs: | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
id: checkout | |
uses: actions/checkout@v3 | |
- name: Get current version | |
id: current_version | |
run: | | |
echo "value=$(cat smart-runner.py | grep -m 1 '__version__' | awk '{print $NF}' | sed 's/"//g')" >> $GITHUB_OUTPUT | |
- name: Get previous version | |
id: previous_version | |
run: | | |
git fetch --tags origin | |
echo "value=$(git tag --sort=committerdate | sed 's/^v//' | tail -1)" >> $GITHUB_OUTPUT | |
- name: Create Tag | |
id: tag | |
if: ${{ steps.current_version.outputs.value != steps.previous_version.outputs.value }} | |
uses: mathieudutour/github-tag-action@v6.1 | |
with: | |
custom_tag: ${{ steps.current_version.outputs.value }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create release | |
id: release | |
if: ${{ steps.current_version.outputs.value != steps.previous_version.outputs.value }} | |
uses: ncipollo/release-action@v1 | |
with: | |
generateReleaseNotes: true | |
name: ${{ steps.tag.outputs.new_tag }} | |
tag: ${{ steps.tag.outputs.new_tag }} |