Skip to content

Commit

Permalink
chore(promote): create promote workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dgutride committed Jun 6, 2023
1 parent 93139aa commit 58f071d
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/promote.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
GIT_USERNAME="patternfly-build"
GH_REPO=${GITHUB_REPOSITORY}
REPO="github.com/${GH_REPO}"
echo "Preparing release environment..."
git config user.email "[email protected]"
git config user.name ${GIT_USERNAME}
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc

echo "Promoting a release..."
# Lerna is complicated. Commands: https://github.com/lerna/lerna/tree/master/commands
# Identify packages that have been updated since the previous tagged release
# Update their versions and changelogs according to angular commit guidelines
# https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit

# publish to github and npm
# yarn run lerna publish --conventional-commits --conventional-graduate --no-private --dist-tag=latest --yes

# dry run
yarn run lerna version --conventional-commits --conventional-graduate --no-private --yes --no-git-tag-version --no-push
25 changes: 25 additions & 0 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: promote
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- v2.*
jobs:
deploy:
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.NPM_SECRET }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "0"
- uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install deps
run: yarn install
- name: Build dist
run: yarn build
- name: Deploy to NPM and Github
run: .github/promote.sh

0 comments on commit 58f071d

Please sign in to comment.