|
| 1 | +name: Release build |
| 2 | + |
| 3 | +on: |
| 4 | + [push] |
| 5 | + # branches: |
| 6 | + # - master |
| 7 | + # tags: |
| 8 | + # - * |
| 9 | + # pull_request: |
| 10 | + # paths: |
| 11 | + # - .github/workflows/lambda-runner-binaries-syncer.yml |
| 12 | + # - "modules/runner-binaries-syncer/lambdas/runner-binaries-syncer/**" |
| 13 | + |
| 14 | +jobs: |
| 15 | + build_syncer: |
| 16 | + name: Build runner binaries syncer |
| 17 | + runs-on: ubuntu-latest |
| 18 | + container: node:12 |
| 19 | + env: |
| 20 | + lambda_name: runner-binaries-syncer |
| 21 | + lambda_path: modules/runner-binaries-syncer/lambdas/runner-binaries-syncer |
| 22 | + defaults: |
| 23 | + run: |
| 24 | + working-directory: ${{ env.lambda_path }} |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v2 |
| 27 | + - name: Install dependencies |
| 28 | + run: yarn install && yarn dist |
| 29 | + - name: Upload distribution |
| 30 | + if: startsWith(github.ref, 'refs/tags/') |
| 31 | + uses: actions/upload-artifact@v1 |
| 32 | + with: |
| 33 | + name: ${{ github.job }} |
| 34 | + path: ${{ env.lambda_path }}/dist |
| 35 | + |
| 36 | + build_webhook: |
| 37 | + name: Build webhook distribution |
| 38 | + runs-on: ubuntu-latest |
| 39 | + container: node:12 |
| 40 | + env: |
| 41 | + lambda_name: webhook |
| 42 | + lambda_path: modules/webhook/lambdas/webhook |
| 43 | + defaults: |
| 44 | + run: |
| 45 | + working-directory: ${{ env.lambda_path }} |
| 46 | + steps: |
| 47 | + - uses: actions/checkout@v2 |
| 48 | + - name: Install dependencies |
| 49 | + run: yarn install && yarn dist |
| 50 | + - name: Upload distribution |
| 51 | + if: startsWith(github.ref, 'refs/tags/') |
| 52 | + uses: actions/upload-artifact@v1 |
| 53 | + with: |
| 54 | + name: ${{ github.job }} |
| 55 | + path: ${{ env.lambda_path }}/dist |
| 56 | + |
| 57 | + build_runners: |
| 58 | + runs-on: ubuntu-latest |
| 59 | + container: node:12 |
| 60 | + env: |
| 61 | + lambda_name: scale-runners |
| 62 | + lambda_path: modules/scale-runners/lambdas/scale-runners |
| 63 | + defaults: |
| 64 | + run: |
| 65 | + working-directory: ${{ env.lambda_path }} |
| 66 | + steps: |
| 67 | + - uses: actions/checkout@v2 |
| 68 | + - name: Install dependencies |
| 69 | + run: yarn install && yarn dist |
| 70 | + - name: Upload distribution |
| 71 | + if: startsWith(github.ref, 'refs/tags/') |
| 72 | + uses: actions/upload-artifact@v1 |
| 73 | + with: |
| 74 | + name: ${{ github.job }} |
| 75 | + path: ${{ env.lambda_path }}/dist |
| 76 | + # release_draft: |
| 77 | + # name: Create Draft Release |
| 78 | + # needs: build |
| 79 | + # runs-on: ubuntu-latest |
| 80 | + # container: node:12 |
| 81 | + # if: startsWith(github.ref, 'refs/tags/') |
| 82 | + # steps: |
| 83 | + # - name: Create Release |
| 84 | + # uses: actions/create-release@latest |
| 85 | + # env: |
| 86 | + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 87 | + # with: |
| 88 | + # tag_name: ${{ github.ref }} |
| 89 | + # release_name: Release ${{ github.ref }} |
| 90 | + # draft: true |
| 91 | + # prerelease: true |
| 92 | + # - uses: actions/checkout@v2 |
| 93 | + # - name: Extract tag name |
| 94 | + # id: tag_name |
| 95 | + # run: echo ::set-output name=TAG::${GITHUB_REF##*/} |
| 96 | + # - uses: actions/download-artifact@v2 |
| 97 | + # with: |
| 98 | + # name: dist |
| 99 | + # path: dist |
| 100 | + # - name: Create zip |
| 101 | + # run: | |
| 102 | + # apt update && apt install zip |
| 103 | + # cd dist && zip -r ../${lambda_name}.zip . |
| 104 | + # - name: Create Release |
| 105 | + # id: create_release |
| 106 | + # uses: actions/create-release@latest |
| 107 | + # env: |
| 108 | + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 109 | + # with: |
| 110 | + # tag_name: ${{ github.ref }} |
| 111 | + # release_name: Release ${{ github.ref }} |
| 112 | + # draft: true |
| 113 | + # prerelease: true |
| 114 | + # - name: Upload Release Asset |
| 115 | + # id: upload-release-asset |
| 116 | + # uses: actions/upload-release-asset@v1 |
| 117 | + # env: |
| 118 | + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 119 | + # with: |
| 120 | + # upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps |
| 121 | + # asset_path: ${{ env.lambda_name }}.zip |
| 122 | + # asset_name: ${{ env.lambda_name }}-${{ steps.tag_name.outputs.TAG }}.zip |
| 123 | + # asset_content_type: application/zip |
0 commit comments