Skip to content

Commit

Permalink
Add changelog; include files in fernignore
Browse files Browse the repository at this point in the history
Signed-off-by: Merit <[email protected]>
  • Loading branch information
meritmalling committed Jul 9, 2024
1 parent 86651ff commit a9166b8
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .fernignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

README.md
LICENSE.txt
cl-config.yml

src/wrapper
src/index.ts

.github/workflows/ci.yml
.github/workflows/cl-create.yml
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ jobs:
- name: Set up node
uses: actions/setup-node@v3

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

- name: Compile
run: yarn && yarn build

Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/cl-create.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
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: Install changelog
run: npm i @flatfile/changelog --save-optional

- 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 }}"
7 changes: 7 additions & 0 deletions cl-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
sourceDirectory: ''
destinationRepo: 'flatfilers/guides'
destinationDirectory: 'platform'
packages:
- name: '@flatfile/api'
dir: ''
type: dataxp

0 comments on commit a9166b8

Please sign in to comment.