chore: Release yew-oauth2 version 0.11.0-alpha.2 #1
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: release | ||
on: | ||
push: | ||
# Releases are tags named 'v<version>', and must have the "major.minor.micro", for example: "0.1.0". | ||
# Release candidates are tagged as `v<version>-rc<num>`, for example: "0.1.0-rc1". | ||
tags: | ||
- "v*" | ||
permissions: | ||
contents: write # for creating a release | ||
jobs: | ||
init: | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
version: ${{steps.version.outputs.version}} | ||
prerelease: ${{steps.state.outputs.prerelease}} | ||
steps: | ||
- name: Evaluate state | ||
id: state | ||
env: | ||
HEAD_REF: ${{github.head_ref}} | ||
run: | | ||
test -z "${HEAD_REF}" && (echo 'do-publish=true' >> $GITHUB_OUTPUT) | ||
if [[ "${{ github.event.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | ||
echo release=true >> $GITHUB_OUTPUT | ||
elif [[ "${{ github.event.ref }}" =~ ^refs/tags/v.*$ ]]; then | ||
echo prerelease=true >> $GITHUB_OUTPUT | ||
fi | ||
- name: Set version | ||
id: version | ||
run: | | ||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | ||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | ||
[ "$VERSION" == "main" ] && VERSION=latest | ||
echo "Version: $VERSION" | ||
echo "version=$VERSION" >> $GITHUB_OUTPUT | ||
# check that our CI would pass | ||
ci: | ||
uses: ./.github/workflows/ci.yaml | ||
Check failure on line 44 in .github/workflows/release.yaml GitHub Actions / .github/workflows/release.yamlInvalid workflow file
|
||
# publish directly after CI check | ||
publish: | ||
needs: [ init, ci ] | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install convco | ||
run: | | ||
curl -sLO https://github.com/convco/convco/releases/download/v0.5.1/convco-ubuntu.zip | ||
unzip convco-ubuntu.zip | ||
sudo install convco /usr/local/bin | ||
- name: Generate changelog | ||
run: | | ||
convco changelog -s --max-majors=1 --max-minors=1 --max-patches=1 -n > /tmp/changelog.md | ||
- name: Create Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TAG: v${{ needs.init.outputs.version }} | ||
run: | | ||
OPTS="" | ||
if [[ "${{ needs.init.outputs.prerelease }}" == "true" ]]; then | ||
OPTS="${OPTS} -p" | ||
fi | ||
gh release create ${OPTS} --title "${{ needs.init.outputs.version }}" -F /tmp/changelog.md ${TAG} |