Skip to content

Add github actions #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will do a clean installation of node dependencies, build the source code and run tests
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Run tests

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Using Node.js from .nvmrc
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"

# caching with actions/setup-node isn't supported with yarn 3
# so we use this workaround https://github.com/actions/setup-node/issues/488
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
shell: bash
- name: Restore yarn cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-

- run: yarn install --immutable
- run: yarn build
- run: yarn test
43 changes: 43 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will run tests using node and then publish a package to NPM when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: Publish to NPM

on:
release:
# Run this on both stable and pre-release
types: [published]

jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# Check out the referred tag in the release
# In case we want to publish something other than HEAD
ref: $GITHUB_SHA
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
registry-url: https://registry.npmjs.org/
scope: "@ftrack"

# caching with actions/setup-node isn't supported with yarn 3
# so we use this workaround https://github.com/actions/setup-node/issues/488
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
shell: bash
- name: Restore yarn cache
uses: actions/cache@v3
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-cache-folder-${{ hashFiles('**/yarn.lock', '.yarnrc.yml') }}
restore-keys: |
yarn-cache-folder-

- run: yarn install --immutable
- run: yarn npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ node_modules

# Build
build/
dist/
package.tgz
.eggs/

# Yarn
Expand All @@ -56,4 +58,4 @@ build/
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/versions
5 changes: 5 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Reference

# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners

* @ftrackhq/frontend
30 changes: 30 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Contributing to @ftrack/api

Thank you for wanting to contribute to our JavaScript API!

Please clone this repository, and follow these instructions to make sure you are in a clean spot before coding:

Using node version as reflected in `.nvmrc`, run:

- yarn install
- yarn test

If the tests passes, you should be good to go. Please submit a PR with your changes and we will look at them as soon as possible.

## Publishing a release

_This is only relevant for ftrack employees when preparing and publishing a new release._

To publish a new release, follow these steps:

Locally:

- `git switch -c release/<new-release-tag>`
- `npm version <new-release-tag>`
- `git push --follow-tags`

On Github:

- Create a new PR from your branch, and get someone to approve it, then merge.
- [Create a new release](https://github.com/ftrackhq/javascript-api/releases/new), pointing to your tag. Generate new release notes based on commit history and clean it up a bit. Choose whether or not it should be a pre-release (your tag should reflect this by appending a beta tag, e.g. `1.0.0-beta.1`)
- Click publish, and make sure the Github action passes. Then you should see a new release on [NPM](https://www.npmjs.com/package/@ftrack/api).
File renamed without changes.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# ftrack Javascript API

Javascript API for ftrack

## Documentation

Full documentation, including installation and setup guides, can be found at
http://ftrack-javascript-api.rtd.ftrack.com/en/stable/

## Contributing

See [CONTRIBUTING](https://github.com/ftrackhq/javascript-api/blob/main/CONTRIBUTING.md)

## Licence

See [LICENCE](https://github.com/ftrackhq/javascript-api/blob/main/LICENSE.txt)
30 changes: 0 additions & 30 deletions README.rst

This file was deleted.

10 changes: 0 additions & 10 deletions bitbucket-pipelines.yml

This file was deleted.

Loading