chore: replase package manager and lint tool (#15) #24
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: | |
branches: | |
- master | |
jobs: | |
build: | |
uses: ./.github/workflows/build.yml | |
release: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
command: manifest | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
ref: 'latest' | |
if: ${{ steps.release.outputs.release_created }} | |
- uses: actions/download-artifact@v3 | |
with: | |
name: dist | |
if: ${{ steps.release.outputs.release_created }} | |
- name: Publish to GitHub | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
major_version: ${{ steps.release.outputs.major }} | |
full_version: ${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} | |
tag_name: ${{ steps.release.outputs.tag_name }} | |
run: | | |
git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY} | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git add . | |
git commit --allow-empty --message "Release v${full_version} at ${GITHUB_SHA}" | |
git tag -d v$major_version || true | |
git tag -d v$full_version || true | |
git tag -a v$major_version -m "Release v$full_version" | |
git tag -a v$full_version -m "Release v$full_version" | |
git push origin latest | |
git push origin v$major_version --force | |
git push origin v$full_version | |
git tag -a $tag_name $GITHUB_SHA -m "Release v$full_version" | |
git push origin $tag_name | |
if: ${{ steps.release.outputs.release_created }} |