Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rbro112 committed Sep 22, 2021
0 parents commit df4544f
Show file tree
Hide file tree
Showing 14 changed files with 12,365 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Don't lint node_modules
node_modules

# Don't lint build output
dist
build

# Ignore eslintrc
.eslintrc.js
9 changes: 9 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: ['airbnb-base', 'airbnb-typescript/base'],
parserOptions: {
project: ['./tsconfig.json']
},
};
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
node_modules
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Emerge upload action

Action to upload your build directly to Emerge for analysis.

## Usage

The Emerge upload action should be run on any event that should trigger a size analysis. Examples of this are:

- When pushing to specific branches (main/release).
- On any PR to the main branch.

See [action.yml](https://github.com/EmergeTools/emerge-upload-action/blob/main/action.yml) for all inputs and
descriptions.

### Create Emerge API key and add to secrets

First, create an Emerge API key. You can create one from your [Emerge profile page](https://www.emergetools.com/profile)
.

![Create Emerge API Key](./docs/api_key.png)

Add the API key to your secrets in your repository. **Do not leave this key in plain text in your workflow!**

[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)

### Incorporate in your workflow

Build your artifact in a step before the Emerge upload action. Pass the generated artifact's path as the `artifact_path`
argument:

```yaml
name: Your workflow

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

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Generate Android release bundle
run: ./gradlew bundleRelease
- name: Upload artifact to Emerge
run: emerge-actions/emerge-upload@v1
with:
artifact_path: ./app/build/outputs/bundle/release/app-release.aab
emerge_api_key: ${{ secrets.EMERGE_API_KEY }}
build_type: release # Optional, change if your workflow builds a specific type
```
After uploading, Emerge will run analysis on the uploaded build. If you haven't, set up Github comments by following
our [Github documentation](https://docs.emergetools.com/docs/github).
For more details about the upload process and Emerge's supported artifact types, see
the [Emerge Uploading docs](https://docs.emergetools.com/docs/uploading-basics).
22 changes: 22 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Emerge Upload"
description: "Github Action for uploading an artifact to Emerge."
author: "EmergeTools"
inputs:
artifact_path:
description: "Relative path from the location of the main workspace runner to the artifact generated in CI."
required: true
emerge_api_key:
description: >
Emerge API token used to access the Emerge API. You can generate
an API key from your Profile page in the Emerge dashboard.
[Learn more about generating an Emerge API key](https://docs.emergetools.com/docs/fastlane#obtain-an-api-key)
Make sure to store this key using Github Action's encrypted secrets.
[Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
required: true
build_type:
description: "The name for the build type (e.g. 'release', 'debug', 'beta')"
required: false
runs:
using: 'node12'
main: 'dist/index.js'
Loading

0 comments on commit df4544f

Please sign in to comment.