1.0.0 #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This workflow will be responsible to pack the app (compiled and not compiled version) to be added as asset on the release | |
| name: Package App | |
| on: | |
| workflow_dispatch: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: write | |
| # This is the main job that will be running in a virtual machine (ubuntu) | |
| jobs: | |
| package: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # L21-L25 This is the checkout step wich is responsible authenticate the workflow | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| persist-credentials: false | |
| ssh-key: '${{ secrets.COMMIT_KEY }}' | |
| # L26-L31 This will set all properties from the app.json to github action env variables | |
| - name: JSON to variables | |
| uses: antifree/[email protected] | |
| with: | |
| filename: 'app.json' | |
| prefix: app | |
| # L33-L36 Setup the nodejs version | |
| - name: Setup Node.js environment | |
| uses: actions/[email protected] | |
| with: | |
| node-version: '14.21.3' | |
| # L40-L41 Install the dependencies | |
| - name: Install dependencies | |
| run: npm i | |
| # L43-L44 Install the apps cli | |
| - name: Install Rocket.Chat Apps cli | |
| run: npm i -g @rocket.chat/apps-cli | |
| # L46-L47 Pack the app (compiled) | |
| - name: Bundle App Compiled | |
| run: rc-apps package | |
| # L49-L50 Renames the pack (compiled) | |
| - name: Renaming Package Name | |
| run: cd dist && mv ${{ env.app_nameSlug }}_${{ env.app_version }}.zip ${{ env.app_nameSlug }}_${{ env.app_version }}-compiled.zip | |
| # L52-L53 Pack the app (not compiled) | |
| - name: Bundle App Not Compiled | |
| run: rc-apps package --no-compile | |
| # L55-L56 Renames the pack (not compiled) | |
| - name: Renaming Not Compiled Package Name | |
| run: cd dist && mv ${{ env.app_nameSlug }}_${{ env.app_version }}.zip ${{ env.app_nameSlug }}_${{ env.app_version }}-not-compiled.zip | |
| # L58-L76 Uploads both compiled and not compiled files inside the release | |
| - name: Upload TimeOff Compiled | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: dist/${{ env.app_nameSlug}}_${{ env.app_version }}-compiled.zip | |
| asset_name: ${{ env.app_nameSlug}}_${{ env.app_version }}-compiled.zip | |
| tag: ${{ env.app_version }} | |
| overwrite: true | |
| body: ${{ github.event.release.body }} | |
| - name: Upload TimeOff Not Compiled | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: dist/${{ env.app_nameSlug }}_${{ env.app_version }}-not-compiled.zip | |
| asset_name: ${{ env.app_nameSlug }}_${{ env.app_version }}-not-compiled.zip | |
| tag: ${{ env.app_version }} | |
| overwrite: true | |
| body: ${{ github.event.release.body }} |