chore(deps): update actions/checkout action to v4.1.1 #46
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
--- | |
# This workflow will run release-please to create a release PR, and tag the release | |
# when a PR is merged into main. | |
name: Release | |
on: # yamllint disable-line rule:truthy | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: google-github-actions/release-please-action@v4 | |
id: release | |
with: | |
release-type: node | |
token: ${{ secrets.ORG_PAT }} | |
package-name: "npm-ci" | |
- uses: actions/checkout@v4 | |
- name: tag major and minor versions | |
shell: pwsh | |
if: ${{ steps.release.outputs.release_created }} | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git remote add gh-token "https://${{ secrets.GITHUB_TOKEN }}@github.com/chill-viking/npm-ci.git" | |
############################## Delete old tags if they exist | |
git tag -d latest || true | |
$majorTag = "v${{ steps.release.outputs.major }}" | |
git tag -d $majorTag || true | |
$minorTag = "v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}" | |
git tag -d $minorTag || true | |
git push origin :latest || true | |
git push origin :$majorTag || true | |
git push origin :$minorTag || true | |
############################## Create tags | |
git tag -a latest -m "Release latest using ${minorTag}" | |
git tag -a $majorTag -m "Release ${majorTag}" | |
git tag -a $minorTag -m "Release ${minorTag}" | |
git push origin latest | |
git push origin $majorTag | |
git push origin $minorTag |