Skip to content

Commit

Permalink
workflow dispatch for release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
seiyria committed Aug 29, 2023
1 parent 66d24b5 commit 68d56c3
Showing 1 changed file with 59 additions and 58 deletions.
117 changes: 59 additions & 58 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Release New Tags

on:
workflow_dispatch:
push:
tags:
- 'v*' # Any pushed tag
Expand All @@ -18,61 +19,61 @@ jobs:
node-version: [18]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- run: npm install

- run: npm run lint

- run: npm run build

- uses: pCYSl5EDgo/cat@master
id: loadChangelog
with:
path: CHANGELOG-current.md

- name: Create Release
id: createRelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.loadChangelog.outputs.text }}
draft: false
prerelease: false

- name: Output Release URL File
run: echo "${{ steps.createRelease.outputs.upload_url }}" > release_url.txt

- name: Save Release URL File for Publish
uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt

- name: Build Blog Post for Version Update
run: npm run blogpost:generate

- name: Read blog_post.txt file
id: getBlogPost
run: echo "filename=$(cat blog-post.txt)" >> $GITHUB_OUTPUT

- name: Publish Version Update Blog Post
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.PUSH_TO_REPO_TOKEN }}
with:
source_file: '${{ steps.getBlogPost.outputs.filename }}'
destination_repo: 'After-the-End-of-All-Things/blog'
destination_folder: '_posts'
user_email: '[email protected]'
user_name: 'seiyria'
commit_message: 'Add version notes'
destination_branch: master
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- run: npm install

- run: npm run lint

- run: npm run build

- uses: pCYSl5EDgo/cat@master
id: loadChangelog
with:
path: CHANGELOG-current.md

- name: Create Release
id: createRelease
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.loadChangelog.outputs.text }}
draft: false
prerelease: false

- name: Output Release URL File
run: echo "${{ steps.createRelease.outputs.upload_url }}" > release_url.txt

- name: Save Release URL File for Publish
uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt

- name: Build Blog Post for Version Update
run: npm run blogpost:generate

- name: Read blog_post.txt file
id: getBlogPost
run: echo "filename=$(cat blog-post.txt)" >> $GITHUB_OUTPUT

- name: Publish Version Update Blog Post
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.PUSH_TO_REPO_TOKEN }}
with:
source_file: '${{ steps.getBlogPost.outputs.filename }}'
destination_repo: 'After-the-End-of-All-Things/blog'
destination_folder: '_posts'
user_email: '[email protected]'
user_name: 'seiyria'
commit_message: 'Add version notes'
destination_branch: master

0 comments on commit 68d56c3

Please sign in to comment.