Skip to content

[[PRERELEASE]] github actions workflow 追加 #1

[[PRERELEASE]] github actions workflow 追加

[[PRERELEASE]] github actions workflow 追加 #1

name: auto versioning for main branch
on:
push:
tags-ignore:
- '**'
branches-ignore:
- main
jobs:
version-up-main:
runs-on: ubuntu-latest
env:
# https://github.community/t/github-action-trigger-on-release-not-working-if-releases-was-created-by-automation/16559
RELEASE_IT_VERSION: 14.14.0
BUMPER_VERSION: 3.0.1
steps:
- name: Check out codes
uses: actions/checkout@v2
- name: Resolve branch name
run: 'echo BRANCH_NAME="${{ github.ref_name }}" >> $GITHUB_ENV'
- name: Resolve branch hash
run: 'echo BRANCH_NAME_HASH="$(echo $BRANCH_NAME | sha256sum)" >> $GITHUB_ENV'
- name: Resolve rc name
run: echo RC_NAME=${BRANCH_NAME_HASH:1:8} >> $GITHUB_ENV
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16'
- name: Release
if: "contains(toJSON(github.event.commits.*.message), '[[PRERELEASE]]') && !contains(toJSON(github.event.commits.*.message), '[automate_versioning_prerelease] Prerelease ')"
run: |
npm i -g release-it@${RELEASE_IT_VERSION}
npm i -g @release-it/bumper@${BUMPER_VERSION}
release-it -- ${UPDATE_ARGS} --ci