Skip to content

Commit

Permalink
feat: add Get app versions (#21)
Browse files Browse the repository at this point in the history
* feat: add Get app versions

* feat: add Get app versions

* feat: minor improvements
  • Loading branch information
yogeshpaliyal authored Apr 21, 2024
1 parent 4c3ada9 commit 618ee19
Show file tree
Hide file tree
Showing 8 changed files with 127 additions and 140 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ jobs:
# keystorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
# keyPassword: ${{ secrets.KEY_PASSWORD }}

- name: Test Get App Detail
- name: Test Get App Versions
id: test-action
uses: ./
with:
type: "GET_APP_STATS"
type: "GET_APP_VERSIONS"
apiKey: ${{secrets.INDUS_API_KEY}}
packageName: com.yogeshpaliyal.keypass

- name: Print Output
id: output
run: echo ${{ steps.test-action.outputs.result }} "Success"
run: echo ${{ steps.test-action.outputs.result }}
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
![Upload-Indus-Appstore](https://github.com/yogeshpaliyal/upload-indus-appstore/assets/9381846/3cd8c2f6-4aa8-4f17-a28e-4af7e6239b84)
# Upload-Indus-AppStore

![Upload-Indus-Appstore](https://github.com/yogeshpaliyal/upload-indus-appstore/assets/9381846/3cd8c2f6-4aa8-4f17-a28e-4af7e6239b84)

<div style="display: inline-block" align="center">
<h1>Upload-Indus-AppStore</h1>
</div>

Upload Android AAB file to Indus App Store.


## Upload AAB File

#### Inputs

| name | description |
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| type | UPLOAD_AAB |
Expand All @@ -22,6 +22,7 @@ Upload Android AAB file to Indus App Store.
| keystorePassword | Password for the alias file

#### Example

```yaml
- name: Upload App to Indus App Store
id: upload-indus-app-store
Expand All @@ -39,21 +40,25 @@ Upload Android AAB file to Indus App Store.
## Get App Details
#### Inputs
| name | description |
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| type | GET_APP_DETAILS |
| apiKey | API Key for Indus App Store, you can get it from Indus AppStore DevTools page |
| packageName | Package Name of the App |
#### Output
| name | description |
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| result | Get App Detail as description |
#### Example
```yaml
- name: Get App Details From Indus App Store
id: upload-indus-app-store
Expand All @@ -70,21 +75,25 @@ Upload Android AAB file to Indus App Store.
## Get App Stats
#### Inputs
| name | description |
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| type | GET_APP_STATS |
| apiKey | API Key for Indus App Store, you can get it from Indus AppStore DevTools page |
| packageName | Package Name of the App |
#### Output
| name | description |
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| result | Get App Detail as description |
#### Example
```yaml
- name: Get App Stats From Indus App Store
id: upload-indus-app-store
Expand All @@ -101,6 +110,7 @@ Upload Android AAB file to Indus App Store.
### Open for Contribution
If you have any idea or want to contribute to this action, feel free to open an issue or PR.
Expand Down
17 changes: 0 additions & 17 deletions __tests__/index.test.ts

This file was deleted.

89 changes: 0 additions & 89 deletions __tests__/main.test.ts

This file was deleted.

25 changes: 0 additions & 25 deletions __tests__/wait.test.ts

This file was deleted.

67 changes: 66 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { UploadApk } from './validator/UploadApk'
import { IValidator } from './validator/IValidator'
import { GetAppDetail } from './validator/getAppDetail'
import { GetAppStats } from './validator/getAppStats'
import { GetAppVersions } from './validator/getAppVersions'

/**
* The main function for the action.
Expand All @@ -18,7 +19,8 @@ export async function run(): Promise<void> {
new UploadAAb(),
new UploadApk(),
new GetAppDetail(),
new GetAppStats()
new GetAppStats(),
new GetAppVersions()
]
for (let i = 0; i < validators.length; i++) {

Check warning on line 25 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Expected a `for-of` loop instead of a `for` loop with this simple iteration
const validator = validators[i]
Expand Down
41 changes: 41 additions & 0 deletions src/validator/getAppVersions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { ActionType, BaseProps } from 'src/constants'
import { IValidator } from './IValidator'
import * as core from '@actions/core'
import { validateStringParameter } from 'src/utils'
import { GetAppDetailProps } from './getAppDetail'


export class GetAppVersions extends IValidator<GetAppDetailProps> {
public type: ActionType = ActionType.GET_APP_VERSIONS

public validateVariables(): GetAppDetailProps {
const data = super.validateVariables()
const packageName: string = core.getInput('packageName')

validateStringParameter('packageName', packageName);

return {
...data,
packageName,
}
}

public async createAntHitRequest(props: GetAppDetailProps) {
const headers = {
Authorization: `Bearer ${props.apiKey}`
}


const axios = require('axios')

const response = await axios.get(
`https://developer-api.indusappstore.com/apis/indus-developerdashboard-service/devtools/app/versions/${props.packageName}`,
{ headers }
)
console.log(response.statusText)
console.log(response.status)
console.log(response.data)
core.debug(response.data)
core.setOutput("result", response.data)
}
}

0 comments on commit 618ee19

Please sign in to comment.