Skip to content

Add cache icon

Add cache icon #83

name: "Create and publish releases"
on:
pull_request:
branches:
- main
types: [closed]
jobs:
release:
name: "Create Release"
runs-on: ubuntu-latest
if: >-
${{ github.event.pull_request.merged == true && (
contains(github.event.pull_request.labels.*.name, 'patch') ||
contains(github.event.pull_request.labels.*.name, 'minor') ||
contains(github.event.pull_request.labels.*.name, 'major') ) }}
steps:
- name: Determine release type
id: release-type
run: |
labels=("${{ join(github.event.pull_request.labels.*.name, ' ') }}")
if [[ "${labels[@]}" == *patch* ]]; then
echo "::set-output name=RELEASE_TYPE::patch"
elif [[ "${labels[@]}" == *minor* ]]; then
echo "::set-output name=RELEASE_TYPE::minor"
elif [[ "${labels[@]}" == *major* ]]; then
echo "::set-output name=RELEASE_TYPE::major"
fi
- name: Checkout the repository
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- name: Setup git user
run: |
git config user.name "Abhay V Ashokan"
git config user.email "[email protected]"
- name: Setup NodeJS LTS version
uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516
with:
node-version-file: '.nvmrc'
- name: Setup the project
run: yarn install
- name: Generate production build for web icons
run: yarn build
- name: Generate production build for native icons
working-directory: ./native
run: yarn generate
- name: Prefix version tag with "v"
run: yarn config set version-tag-prefix "v"
- name: Disable Git commit hooks
run: git config core.hooksPath /dev/null
- name: Bump version and create tags for web icons
run: yarn version --new-version ${{ steps.release-type.outputs.RELEASE_TYPE }} --no-git-tag-version
- name: Bump version and create tags for native icons
working-directory: ./native
run: yarn version --new-version ${{ steps.release-type.outputs.RELEASE_TYPE }} --no-git-tag-version
- name: Create a new version release commit
uses: EndBug/add-and-commit@050a66787244b10a4874a2a5f682130263edc192
with:
message: "New version release"
- name: Push the commit to main
uses: ad-m/github-push-action@492de9080c3179a3187bd456763f988f9a06e196
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
- name: Publish web icons to NPM
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc && yarn publish --access public
- name: Publish native icons to NPM
working-directory: ./native
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc && yarn publish --access public
- name: Get the package version from package.json
uses: tyankatsu0105/read-package-version-actions@5aad2bb630a577ee4255546eb3ee0593df68f6ca
id: package-version
- name: Create a release draft on release
uses: release-drafter/release-drafter@ac463ffd9cc4c6ad5682af93dc3e3591c4657ee3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: v${{ steps.package-version.outputs.version }}
publish: true