Merge pull request #1 from podaac/release/1.0.0 #21
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: Build 'n Deploy | |
permissions: | |
packages: write | |
on: | |
push: | |
branches: | |
- '*' | |
tags-ignore: | |
- '*' | |
paths-ignore: | |
- 'package.json' | |
- 'package-lock.json' | |
- 'bumpver.toml' | |
jobs: | |
build: | |
name: build, lint, and test | |
runs-on: ubuntu-latest | |
steps: | |
# -- Setup -- | |
- uses: getsentry/action-github-app-token@v3 | |
name: my-app-install token | |
id: podaac-cicd | |
with: | |
app_id: ${{ secrets.CICD_APP_ID }} | |
private_key: ${{ secrets.CICD_APP_PRIVATE_KEY }} | |
- uses: actions/checkout@v3 | |
with: | |
repository: ${{ github.repository }} | |
token: ${{ steps.podaac-cicd.outputs.token }} | |
submodules: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install bumpver | |
run: pip3 install bumpver | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
registry-url: 'https://npm.pkg.github.com' | |
- name: Setup git user | |
run: | | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
- name: Install package | |
run: npm ci | |
# -- Linting -- | |
- name: Lint | |
run: npm run lint | |
# -- Version Bumping -- | |
- name: Bump alpha version | |
if: github.ref == 'refs/heads/develop' | |
run: | | |
TAG=$(bumpver show -e | awk -F= '$1 == "TAG" {print $2};') | |
if [ $TAG == 'final' ]; then | |
# Bump patch version first then append tag | |
bumpver update --patch --tag alpha --tag-num | |
else | |
bumpver update --tag alpha --tag-num | |
fi | |
- name: Bump rc version | |
if: startsWith(github.ref, 'refs/heads/release/') | |
run: bumpver update --patch --tag rc --tag-num | |
- name: Release version | |
if: github.ref == 'refs/heads/main' | |
run: bumpver update --patch --tag final | |
# -- Publish -- | |
- name: Publish | |
if: | | |
startsWith(github.ref, 'refs/heads/release/') || | |
github.ref == 'refs/heads/main' | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |