Release 2.2.0 #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create GitHub Release | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- '**/*.yml' | |
- 'src/**' | |
- 'package.json' | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Cache firebase emulators | |
# Firebase Emulator caching technique: https://stackoverflow.com/a/66422608/188740 | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/firebase/emulators | |
key: ${{runner.os}}-firebase-emulators-${{hashFiles('~/.cache/firebase/emulators/**')}} | |
- run: npm install -g firebase-tools@12.4.2 | |
- run: npm ci | |
- run: npm run compile | |
- run: npm test | |
version_check: | |
needs: test | |
runs-on: ubuntu-latest | |
outputs: | |
# https://github.saobby.my.eu.orgmunity/t/sharing-a-variable-between-jobs/16967/14 | |
changed: ${{steps.check.outputs.changed}} | |
version: ${{steps.check.outputs.version}} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Check if version changed in package.json | |
id: check | |
uses: EndBug/version-check@v2 # https://github.com/marketplace/actions/version-check | |
with: | |
diff-search: true | |
file-name: ./package.json | |
create_release: | |
needs: version_check | |
if: ${{needs.version_check.outputs.changed == 'true'}} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Create Release | |
# https://github.com/actions/create-release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
# Must use personal access token and not secrets.GITHUB_TOKEN to trigger on.release.created event, which publish.yml watches for | |
# https://github.saobby.my.eu.orgmunity/t/github-action-trigger-on-release-not-working-if-releases-was-created-by-automation/16559 | |
GITHUB_TOKEN: ${{secrets.JOHNNY_PERSONAL_GITHUB_TOKEN}} | |
with: | |
tag_name: v${{needs.version_check.outputs.version}} | |
release_name: Release ${{needs.version_check.outputs.version}} | |
body: | | |
@examind/ltijs-firestore | |
draft: false | |
prerelease: false |