|
| 1 | +name: Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '*' |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Get version from tag |
| 13 | + id: tag_name |
| 14 | + run: | |
| 15 | + echo ::set-output name=current_version::${GITHUB_REF#refs/tags/} |
| 16 | + shell: bash |
| 17 | + - uses: actions/checkout@v2 |
| 18 | + - name: Get Changelog Entry |
| 19 | + id: changelog_reader |
| 20 | + uses: mindsers/changelog-reader-action@v2 |
| 21 | + with: |
| 22 | + validation_depth: 10 |
| 23 | + version: ${{ steps.tag_name.outputs.current_version }} |
| 24 | + path: ./CHANGELOG.md |
| 25 | + - uses: actions/setup-node@v1 |
| 26 | + with: |
| 27 | + node-version: ${{ matrix.node-version }} |
| 28 | + - name: Install node dependencies |
| 29 | + run: npm install |
| 30 | + - name: Set up Ruby 2.7 |
| 31 | + uses: actions/setup-ruby@v1 |
| 32 | + with: |
| 33 | + ruby-version: 2.7.2 |
| 34 | + - uses: actions/cache@v1 |
| 35 | + with: |
| 36 | + path: vendor/bundle |
| 37 | + key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} |
| 38 | + restore-keys: | |
| 39 | + ${{ runner.os }}-gems- |
| 40 | + - name: Install gems |
| 41 | + run: | |
| 42 | + gem install bundler |
| 43 | + bundle config path vendor/bundle |
| 44 | + bundle install --standalone --path vendor/bundle --jobs 4 --retry 3 |
| 45 | + - name: Create artifact |
| 46 | + run: | |
| 47 | + npx serverless package |
| 48 | + - name: Create Release |
| 49 | + id: create_release |
| 50 | + uses: actions/create-release@v1 |
| 51 | + env: |
| 52 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 53 | + with: |
| 54 | + tag_name: ${{ github.ref }} |
| 55 | + release_name: Release ${{ github.ref }} |
| 56 | + body: ${{ steps.changelog_reader.outputs.changes }} |
| 57 | + prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }} |
| 58 | + draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }} |
| 59 | + - name: Upload Release Asset |
| 60 | + uses: actions/upload-release-asset@v1 |
| 61 | + env: |
| 62 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + with: |
| 64 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 65 | + asset_path: .serverless/s3-decompression-lambda.zip |
| 66 | + asset_name: s3-decompression-lambda.zip |
| 67 | + asset_content_type: application/zip |
0 commit comments