Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Try pr semantic 6 #174

Merged
merged 2 commits into from
Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 125 additions & 0 deletions .github/workflows/release-hook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Release Hook

on:
workflow_dispatch:
push:
paths:
- 'package.json'
branches: ['main']

jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
released: ${{ steps.persist_release.outputs.released }}
changelog: ${{ steps.persist_release.outputs.changelog }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-node@v2
with:
node-version: '14'
registry-url: 'https://registry.npmjs.org'

- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-

- uses: pnpm/[email protected]
with:
version: 6.23.2
run_install: true

- name: Automatic GitHub Release
uses: justincy/[email protected]
id: release

- name: Publish
if: steps.release.outputs.released == 'true'
run: pnpm publish:npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Fetch Release
if: steps.release.outputs.released == 'true'
uses: cardinalby/git-get-release-action@v1
id: fetch_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ steps.release.outputs.release_id }}

- name: Output Release Changelog
if: steps.release.outputs.released == 'true'
run: echo "${{ steps.fetch_release.outputs.body }}"


- name: Persist Release
if: steps.release.outputs.released == 'true'
id: persist_release
env:
RAW_CHANGELOG: ${{ steps.fetch_release.outputs.body }}
REPO_URL: 'https://github.com/${{ github.repository }}'
run: |
echo "::set-output name=released::${{ steps.release.outputs.released }}"
echo "::set-output name=changelog::$(node ./scripts/rewrite-changelog.js RAW_CHANGELOG $REPO_URL)"

bump_zapper_studio:
name: Bump on Zapper API
needs: [release]
runs-on: ubuntu-latest
if: ${{ needs.release.outputs.released == 'true' }}
strategy:
matrix:
repository: [Zapper-fi/zapper-api]
steps:
- name: Checkout ${{ matrix.repository }}
uses: actions/checkout@v2
with:
repository: ${{ matrix.repository }}
fetch-depth: 0
token: ${{ secrets.GH_ZAPPER_BOT }}
ref: master

- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '14'
registry-url: 'https://registry.npmjs.org'

- uses: pnpm/[email protected]
with:
version: 6.23.2
run_install: true

- name: Upgrade dependencies
run: |
pnpm up @zapper-fi/studio@latest

- name: Set Target Branch
id: set_target_branch
run: |
TARGET_BRANCH=bump-zapper-studio
echo "::set-output name=target_branch::$TARGET_BRANCH"

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GH_ZAPPER_BOT }}
branch: ${{ steps.set_target_branch.outputs.target_branch }}
title: 🎨🖌️ Bump Zapper Studio
commit-message: Bump Zapper Studio
body: |
⚙️ _This pull request was opened automatically from Zapper-fi/studio._

${{ needs.release.outputs.changelog }}
base: master
delete-branch: true
5 changes: 3 additions & 2 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
- name: Bump Version
run: pnpm semantic-release

- name: Delete Automatic Tag
run: "git push --delete origin $(git describe --tags $(git rev-list --tags --max-count=1))"

- name: Get Package Version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
Expand All @@ -48,7 +51,5 @@ jobs:
commit-message: "chore(release): Release ${{ steps.package-version.outputs.current-version }}"
body: |
⚙️ _This pull request was opened automatically from Zapper-fi/studio._

${{ needs.release.outputs.changelog }}
base: main
delete-branch: true
1 change: 1 addition & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"branches": ["main"],
"tagFormat": "${version}",
"plugins": [
["@semantic-release/npm", {
"npmPublish": false
Expand Down