Skip to content

Downgrade action version for release pipeline #33

Downgrade action version for release pipeline

Downgrade action version for release pipeline #33

Workflow file for this run

name: Release
on:
push:
branches:
- "main"
jobs:
tag:
name: Check and Tag
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get latest tag
uses: actions-ecosystem/action-get-latest-tag@v1
with:
with_initial_version: false
id: get-latest-tag
- name: Create tag
id: tag
uses: butlerlogic/action-autotag@1.1.2
with:
tag_prefix: "v"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
outputs:
tag: ${{ steps.tag.outputs.tagname }}
previous_tag: ${{ steps.get-latest-tag.outputs.tag }}
version: ${{ steps.tag.outputs.version }}
release:
name: Publish
runs-on: ubuntu-latest
needs: tag
if: needs.tag.outputs.tag != ''
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/fermium"
- run: yarn install
- run: yarn build
- name: Generate changelog
id: changelog
uses: janheinrichmerker/action-github-changelog-generator@v2.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
issues: "false"
pullRequests: "true"
prWoLabels: "true"
author: "true"
usernamesAsGithubLogins: "true"
compareLink: "true"
filterByMilestone: "false"
unreleased: "false"
sinceTag: "${{ needs.tag.outputs.previous_tag }}"
maxIssues: "0"
stripGeneratorNotice: "true"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.tag.outputs.tag }}
body_path: "CHANGELOG.md"
release_name: Release ${{ needs.tag.outputs.tag }}
prerelease: true # we can promote to release trough github
# From https://github.com/lerna/lerna/issues/2404
- run: echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to npm registry
run: yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# in case of failure
- name: Rollback on failure
if: failure()
uses: author/action-rollback@9ec72a6af74774e00343c6de3e946b0901c23013
with:
id: ${{ steps.create_release.outputs.id }}
tag: ${{ needs.tag.outputs.tag }}
delete_orphan_tag: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}