fix: error with base branch (github action) #3
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 Create Release | |
on: | |
pull_request: | |
types: [closed] | |
jobs: | |
publish: | |
if: > | |
${{ github.event.pull_request.merged == true && | |
startsWith(github.event.pull_request.head.ref, 'bump-version-') }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v2 | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: Get the latest tag | |
id: get_latest_tag | |
run: echo "latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV | |
- name: Publish to Crates.io | |
run: cargo publish --token ${CRATES_TOKEN} | |
env: | |
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }} | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.latest_tag }} | |
release_name: ${{ env.latest_tag }} | |
body: | | |
Changes in this Release: | |
- **Will be listed** | |
Please edit this release to add more details. | |
draft: true | |
prerelease: false |