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 authored Jul 18, 2023
1 parent c5c919d commit 6237175
Show file tree
Hide file tree
Showing 24 changed files with 30,464 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:
- 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

- name: Setup git
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions[bot]"
- 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: Generate token
if: ${{ github.ref_name == 'main'}}
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.FUNDABOT_APP_ID }}
private_key: ${{ secrets.FUNDABOT_PRIVATE_KEY }}

- name: Release
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token || secrets.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
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token || secrets.GITHUB_TOKEN }}
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"
7 changes: 7 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"packages": [
"packages/*"
],
"useWorkspaces": true,
"version": "0.0.1-alpha.1"
}
Loading

0 comments on commit 6237175

Please sign in to comment.