Skip to content

Commit

Permalink
Add npm deployment workflow (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
oblador authored Oct 27, 2022
1 parent d35addb commit 6ff09a2
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 17 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deployment

on:
push:
branches: [master]

jobs:
deployment:
name: Release new version
if: github.repository_owner == 'klarna-incubator'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
run: yarn --frozen-lockfile --non-interactive --silent --ignore-scripts
- name: Publish to NPM
id: publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Create release
if: steps.publish.outputs.type != 'none'
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.publish.outputs.version }}
release_name: ${{ steps.publish.outputs.version }}
body: ${{ steps.publish.outputs.version }}
draft: true
prerelease: false
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install dependencies
Expand Down
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@ The first time you run the command it will prompt you which platforms you want t
```js
// platform-colors.config.js
module.exports = {
"colors": {
"background": {
"light": "#ffffff",
"dark": "#000000"
colors: {
background: {
light: '#ffffff',
dark: '#000000',
},
"accent": "pink"
accent: 'pink',
},
"javascript": {
"typescript": true,
"outputDirectory": "src/colors/"
javascript: {
typescript: true,
outputDirectory: 'src/colors/',
},
ios: {
outputDirectory: 'ios/YourApp/Images.xcassets/',
},
"ios": {
"outputDirectory": "ios/YourApp/Images.xcassets/"
android: {
outputDirectory: 'android/app/src/main/res/',
},
"android": {
"outputDirectory": "android/app/src/main/res/"
css: {
outputDirectory: 'static/css/',
},
"css": {
"outputDirectory": "static/css/"
}
};
```

Expand Down Expand Up @@ -105,6 +105,7 @@ Example:
An object containing `outputDirectory` which should be an Android `res` directory.

Example:

```js
{
android: {
Expand Down Expand Up @@ -206,6 +207,10 @@ yarn android

See our [changelog](CHANGELOG.md).

## Deployment

Update version in `package.json` and merge to master. This will publish the package to NPM, create a draft release on GitHub and a version tag. Edit the release with additional information and publish it.

Copyright © 2021 Klarna Bank AB

For license details, see the [LICENSE](LICENSE) file in the root of this project.
Expand Down

0 comments on commit 6ff09a2

Please sign in to comment.