|
| 1 | +# `srcpush-github-action` GitHub Action |
| 2 | + |
| 3 | +Configures the Source Push Command Line Interface in the GitHub Actions environment. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- This action runs using Node 20. If you are using self-hosted GitHub Actions |
| 8 | + runners, you must use a [runner version](https://github.com/actions/virtual-environments) that supports this |
| 9 | + version or newer. |
| 10 | + |
| 11 | +## Usage |
| 12 | + |
| 13 | +GitHub action supports all the commands available in the Source Push CLI of appropriate version. |
| 14 | +Please keep in mind that some commands (such as `release-react`) need to be executed and make sense only after you have |
| 15 | +loaded all the dependencies of your project and build React Native app. |
| 16 | + |
| 17 | +```yaml |
| 18 | +jobs: |
| 19 | + job_id: |
| 20 | + # Any runner supporting Node 20 or newer |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - name: Setup Source Push CLI |
| 24 | + uses: 'srcpush/srcpush-github-action@v1' |
| 25 | + id: setup-srcpush-cli |
| 26 | + with: |
| 27 | + version: 'latest' |
| 28 | + accessKey: ${{ secrets.SRCPUSH_ACCESS_KEY }} |
| 29 | + - name: Release Android bundle |
| 30 | + run: srcpush release-react myAmazingAndroidApp android -d Staging |
| 31 | + - name: Release ios bundle |
| 32 | + run: srcpush release-react myAmazingIOSApp ios -d Staging |
| 33 | +``` |
| 34 | +
|
| 35 | +## Inputs |
| 36 | +
|
| 37 | +- `version`(Optional, default: `latest`). |
| 38 | + A string representing the version or version constraint of the Source Push CLI |
| 39 | + (`srcpush`) to install (e.g. `"0.0.3"` or `">= 0.0.2"`). The default |
| 40 | + value is `"latest"`, which will always download and install the latest |
| 41 | + available CLI version. |
| 42 | + |
| 43 | + - uses: 'srcpush/srcpush-github-action@v1' |
| 44 | + with: |
| 45 | + version: '>= 0.0.3' |
| 46 | + |
| 47 | + If there is no installed `srcpush` version that matches the given |
| 48 | + constraint, this GitHub Action will download and install the latest |
| 49 | + available version that still matches the constraint. |
| 50 | + |
| 51 | + You are responsible for ensuring the `srcpush` version matches the features required. |
| 52 | + |
| 53 | +- `accessKey`(Optional). Source Push access key created in the [app](http://console.srcpush.com/). Considered to be a secret. |
| 54 | + |
| 55 | + - uses: 'srcpush/srcpush-github-action@v1' |
| 56 | + with: |
| 57 | + accessKey: ${{ secrets.SRCPUSH_ACCESS_KEY }} |
| 58 | + |
| 59 | + You are responsible for ensuring the accessKey was not neither expired nor deleted. |
| 60 | + |
| 61 | + If no accessKey given you must authenticate CLI before executing any commands require authentication |
| 62 | + |
| 63 | + - name: Authenticate Source Push CLI |
| 64 | + run: srcpush login --accessKey ${{ secrets.SRCPUSH_ACCESS_KEY }} |
| 65 | + |
| 66 | +## Outputs |
| 67 | + |
| 68 | +- `version`: Version of Source Push CLI that was installed. |
| 69 | + |
| 70 | +## Caching |
| 71 | + |
| 72 | +Under the hood action uses [@actions/tool-cache](https://www.npmjs.com/package/@actions/tool-cache) npm package to |
| 73 | +cache installed tooling (`/opt/hostedtoolcache/srcpush`) to speed up further workflow executions. |
| 74 | +It works out the box for self-hosted runners where for GitHub-hosted runners the following config is needed to persist |
| 75 | +changes made by action: |
| 76 | + |
| 77 | +```yaml |
| 78 | + - name: Tools cache |
| 79 | + id: tool-caches |
| 80 | + uses: actions/cache@v4 |
| 81 | + with: |
| 82 | + path: /opt/hostedtoolcache/srcpush |
| 83 | + key: srcpush-${{ runner.os }}-${{ github.run_id }} |
| 84 | + restore-keys: | |
| 85 | + srcpush-${{ runner.os }}- |
| 86 | +``` |
| 87 | + |
| 88 | +## Versioning |
| 89 | + |
| 90 | +We recommend pinning to the latest available major version: |
| 91 | + |
| 92 | +```yaml |
| 93 | +- uses: 'srcpush/srcpush-github-action@v1' |
| 94 | +``` |
| 95 | + |
| 96 | +While this action attempts to follow semantic versioning, human errors can occur. |
| 97 | +To avoid accidental breaking changes, you can pin to a specific version: |
| 98 | + |
| 99 | +```yaml |
| 100 | +- uses: 'srcpush/srcpush-github-action@v1.0.0' |
| 101 | +``` |
| 102 | + |
| 103 | +However, you will not get automatic security updates or new features without |
| 104 | +explicitly updating your version number. |
| 105 | + |
| 106 | +## Questions, Issues and Support |
| 107 | + |
| 108 | +If you have any questions or issues with this action, please [open an issue](https://github.com/srcpush/srcpush-github-action/issues) |
| 109 | +on this repository or send email to [support@srcpush.com](mailto:support@srcpush.com). |
0 commit comments