Skip to content

Commit

Permalink
fw-avatar (#10)
Browse files Browse the repository at this point in the history
* avatar and styles component
* tests for avatar
* github actions for auto bump
[bump major]

Co-authored-by: Balraj Gahlot <[email protected]>
Co-authored-by: github-actions[bot] <[email protected]>
  • Loading branch information
3 people committed Jul 28, 2023
1 parent c5c919d commit 6f72838
Show file tree
Hide file tree
Showing 24 changed files with 30,472 additions and 0 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Publish packages

on:
push:
branches-ignore:
- "dependabot/**"

env:
BRANCH_TAG: ${{ github.ref_name == 'main' && 'latest' || github.ref_name }}
BRANCH: ${{ github.ref_name }}

jobs:
build_test_publish:
runs-on: ubuntu-latest
environment: "${{ github.ref_name == 'main' && 'prod' || '' }}"
steps:
- name: Generate token
if: ${{ github.ref_name == 'main'}}
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ vars.FUNDABOT_APP_ID }}
private_key: ${{ secrets.FUNDABOT_PRIVATE_KEY }}

- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org

- uses: actions/checkout@v3
with:
# pulls all commits and tags (needed for lerna to correctly version)
fetch-depth: 0
token: ${{ github.ref_name == 'main' && steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}

- name: Setup git
run: |
git config --global user.email "[email protected]"
git config --global user.name "fundabot"
- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Run tests
run: npm run test

- name: Publish packages
env:
MAJOR_VERSION: ${{ contains(github.event.head_commit.message , '[bump major]') }}
MINOR_VERSION: ${{ contains(github.event.head_commit.message , '[bump minor]') }}
NODE_AUTH_TOKEN: ${{secrets.NPMJS_TOKEN}}
run: |
VERSION=${{ github.ref_name == 'main' && 'patch' || 'prerelease' }}
if [ ${{ github.ref_name }} == 'main' ]
then
if [ $MINOR_VERSION == true ]; then VERSION="minor"; fi
if [ $MAJOR_VERSION == true ]; then VERSION="major"; fi
fi
echo "Updating $VERSION.."
npm run publish -- $VERSION --yes --dist-tag=$BRANCH_TAG --no-push --preid ${{ github.ref_name }} ${{ github.ref_name == 'main' && '' || '--include-merged-tags' }}
TAG="`git describe --tags --abbrev=0`"
echo "Published tag $TAG"
echo "TAG=$TAG" >> $GITHUB_ENV
- name: Release
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ "${BRANCH}" != "main" ]; then PRERELEASE="-p"; fi
echo "Releasing version ${TAG} on branch ${BRANCH}"
gh release create ${TAG} --target ${BRANCH} --generate-notes ${PRERELEASE}
- name: Push changes
run: git push --follow-tags --atomic --no-verify
4 changes: 4 additions & 0 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
threshold: medium
scopeconfig:
- scope: node
version: "1.0"
12 changes: 12 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"packages": [
"packages/*"
],
"useWorkspaces": true,
"version": "1.0.0",
"command": {
"version": {
"message": "chore(release): publish %s \n [skip ci]"
}
}
}
Loading

0 comments on commit 6f72838

Please sign in to comment.