|
| 1 | +name: Releases |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/checkout@v2 |
| 12 | + - uses: actions/setup-node@v1 |
| 13 | + with: |
| 14 | + node-version: '12.x' |
| 15 | + - run: npm install |
| 16 | + |
| 17 | + - name: get-npm-version |
| 18 | + id: package-version |
| 19 | + uses: martinbeentjes/npm-get-version-action@master |
| 20 | + - name: install npm packall |
| 21 | + run: npm install npm-pack-all |
| 22 | + |
| 23 | + - run: node node_modules/.bin/npm-pack-all |
| 24 | + - uses: Klemensas/action-autotag@stable |
| 25 | + id: update_tag |
| 26 | + with: |
| 27 | + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 28 | + tag_prefix: "v" |
| 29 | + - name: Create Release |
| 30 | + if: steps.update_tag.outputs.tagname |
| 31 | + uses: actions/create-release@v1 |
| 32 | + id: create_release |
| 33 | + env: |
| 34 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 35 | + with: |
| 36 | + tag_name: ${{ steps.update_tag.outputs.tagname }} |
| 37 | + release_name: Release ${{ steps.update_tag.outputs.tagname }} |
| 38 | + draft: false # Default value, but nice to set explicitly |
| 39 | + prerelease: false # Default value, but nice to set explicitly |
| 40 | + - name: Upload Release Asset |
| 41 | + if: steps.update_tag.outputs.tagname |
| 42 | + id: upload-release-asset |
| 43 | + uses: actions/upload-release-asset@v1 |
| 44 | + env: |
| 45 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 46 | + with: |
| 47 | + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing its 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 |
| 48 | + asset_path: ./contentstack-cli-cm-regex-validate-${{ steps.package-version.outputs.current-version }}.tgz |
| 49 | + asset_name: contentstack-cli-cm-regex-validate-${{ steps.package-version.outputs.current-version }}.tgz |
| 50 | + asset_content_type: application/tgz |
0 commit comments