Skip to content

Commit

Permalink
[[PRERELEASE]] github actions workflow 追加
Browse files Browse the repository at this point in the history
  • Loading branch information
HiroyaNakakawaji committed Apr 11, 2023
1 parent 4ce59cd commit 7b63eb8
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release-default.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: release apps

on:
push:
branches-ignore:
- '**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pip install wheel
- name: Build
run: |
pipenv run clean
pipenv run build
pipenv run deploy
28 changes: 28 additions & 0 deletions .github/workflows/release-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: release RC apps

on:
push:
branches-ignore:
- '**'
# prerelease only
tags:
- '[0-9]+.[0-9]+.[0-9]+rc[0-9]+'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pip install wheel
- name: Build
run: |
pipenv run clean
pipenv run build
pipenv run test-deploy
40 changes: 40 additions & 0 deletions .github/workflows/versioning-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: auto versioning for main branch
on:
push:
tags-ignore:
- '**'
branches:
- 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: Setup Node
uses: actions/setup-node@v1
with:
node-version: '16'
# バージョン更新コミットは対象外
- name: Patch release
if: "!contains(toJSON(github.event.commits.*.message), '[automate_versioning] Release')"
run: |
echo 'UPDATE_ARGS=patch' >> $GITHUB_ENV
- name: Minor release
if: contains(toJSON(github.event.commits.*.message), '[[MINOR]]')
run: |
echo 'UPDATE_ARGS=minor' >> $GITHUB_ENV
- name: Major release
if: contains(toJSON(github.event.commits.*.message), '[[MAJOR]]')
run: |
echo 'UPDATE_ARGS=major' >> $GITHUB_ENV
- name: Release
if: "env.UPDATE_ARGS != ''"
run: |
npm i -g release-it@${RELEASE_IT_VERSION}
npm i -g @release-it/bumper@${BUMPER_VERSION}
release-it -- ${UPDATE_ARGS} --ci
33 changes: 33 additions & 0 deletions .github/workflows/versioning-prerelease.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
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

0 comments on commit 7b63eb8

Please sign in to comment.