Skip to content
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

Add npm deployment workflow #38

Merged
merged 1 commit into from
Oct 27, 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
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