Skip to content

Commit

Permalink
chore: automate package publishing
Browse files Browse the repository at this point in the history
Signed-off-by: zeshanziya <zeshan.ziya@axelerant.com>
  • Loading branch information
zeshanziya committed Sep 25, 2024
1 parent 70f8251 commit 88a385d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,41 @@ jobs:
with:
node-version: 18

- name: Install Yarn
run: npm install -g yarn

- name: Get Yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Cache Yarn dependencies
uses: actions/cache@v4
id: yarn-cache
with:
path: |
**/node_modules
${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-bs-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-bs-
- name: Install Dependencies
run: yarn install --immutable

- name: Create Release Pull Request
- name: Run linter
run: yarn lint

- name: Run Code formatting check
run: yarn prettier:check

- name: Run tests
run: yarn test

- name: Create Release Pull Request or Publish to NPM
uses: changesets/action@v1
with:
version: yarn release:version
publish: yarn release:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"lint": "backstage-cli repo lint --since origin/main",
"lint:all": "backstage-cli repo lint",
"prettier:check": "prettier --check .",
"new": "backstage-cli new --scope internal"
"new": "backstage-cli new --scope internal",
"release:version": "changeset version && prettier --write '{packages,plugins}/*/{package.json,CHANGELOG.md}' && yarn install",
"release:publish": "tsc && build:all && changeset publish"
},
"workspaces": {
"packages": [
Expand Down

0 comments on commit 88a385d

Please sign in to comment.