Skip to content

Commit

Permalink
Install change log for automated updates (#140)
Browse files Browse the repository at this point in the history
* Install changelog for automated updates

Signed-off-by: Merit <[email protected]>

* Add auth to other actions

Signed-off-by: Merit <[email protected]>

* Remove angular temporarily until it is no longer a manual release

Signed-off-by: Merit <[email protected]>

---------

Signed-off-by: Merit <[email protected]>
  • Loading branch information
meritmalling authored Jul 3, 2024
1 parent 25a89ef commit 8106bfa
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 6 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/cl-create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Create a changelog update

on:
push:
tags:
- '@**'
- '**'

jobs:
changelog:
name: Changelog
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3

- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc

- name: Install dependencies
run: npm ci

- name: Set tag variable
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
- name: Set variables from cl-config.yml
run: |
destinationRepo=$(yq e '.destinationRepo' cl-config.yml)
destinationDirectory=$(yq e '.destinationDirectory' cl-config.yml)
echo "DESTINATION_REPO=${destinationRepo}" >> $GITHUB_ENV
echo "DESTINATION_DIRECTORY=${destinationDirectory}" >> $GITHUB_ENV

- name: Create a changelog update
run: npx changelog generate ${{ env.TAG_NAME }}
env:
CLAUDE_API_KEY: ${{ secrets.CLAUDE_API_KEY }}

- name: Get changelog update file name
run: |
FILE_NAME=$(ls temp)
echo "FILE_NAME=$FILE_NAME" >> $GITHUB_ENV
- name: Create branch in guides repo with changelog update
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.GH_TOKEN }}
with:
source_file: temp/${{ env.FILE_NAME}}
destination_repo: ${{ env.DESTINATION_REPO }}
destination_folder: changelog/src/${{ env.DESTINATION_DIRECTORY }}
destination_branch_create: changelog/${{ env.TAG_NAME }}
user_email: ${{ github.actor }}
user_name: github-actions[bot]
commit_message: "Updating the changelog for ${{ env.TAG_NAME }}"
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
node-version: 18.x
cache: 'npm'

- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc

- name: Install Dependencies
run: npm ci

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ jobs:
node-version: 18.x
cache: 'npm'

- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc

- name: Install Dependencies
run: npm ci

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
node-version: 18
cache: 'npm'

- name: Authenticate with private NPM package
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc

- name: Install dependencies
run: npm ci

Expand Down
19 changes: 19 additions & 0 deletions cl-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
sourceDirectory: 'packages'
destinationRepo: 'flatfilers/guides'
destinationDirectory: 'libraries'
packages:
- name: 'flatfile'
dir: cli
type: core
- name: '@flatfile/javascript'
dir: wrappers
type: wrappers
- name: '@flatfile/listener'
dir: listener
type: listener
- name: '@flatfile/react'
dir: react
type: wrappers
- name: '@flatfile/vue'
dir: vue
type: wrappers
29 changes: 23 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"typescript": "~5.1.3"
},
"dependencies": {
"@flatfile/changelog": "^0.0.3",
"esbuild-loader": "^2.20.0",
"rollup": "^2.79.1"
},
Expand Down

0 comments on commit 8106bfa

Please sign in to comment.