|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - '*' |
| 7 | + |
| 8 | +env: |
| 9 | + YARN_CACHE_FOLDER: ~/.yarn |
| 10 | + |
| 11 | +jobs: |
| 12 | + test: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v2 |
| 16 | + - uses: actions/cache@v1 |
| 17 | + with: |
| 18 | + path: ${{ env.YARN_CACHE_FOLDER }} |
| 19 | + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 20 | + restore-keys: | |
| 21 | + ${{ runner.os }}-yarn- |
| 22 | + - uses: actions/setup-node@v1 |
| 23 | + with: |
| 24 | + node-version: '12.x' |
| 25 | + registry-url: https://registry.npmjs.org |
| 26 | + - name: install |
| 27 | + run: yarn --frozen-lockfile |
| 28 | + |
| 29 | + # lint, test, report coverage |
| 30 | + - name: lint |
| 31 | + run: yarn lint |
| 32 | + - name: test |
| 33 | + run: yarn test |
| 34 | + |
| 35 | + # upload coverage |
| 36 | + - name: Coveralls |
| 37 | + uses: coverallsapp/github-action@master |
| 38 | + with: |
| 39 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 40 | + |
| 41 | + publish: |
| 42 | + needs: test |
| 43 | + runs-on: ubuntu-latest |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v2 |
| 46 | + - uses: actions/cache@v1 |
| 47 | + with: |
| 48 | + path: ${{ env.YARN_CACHE_FOLDER }} |
| 49 | + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} |
| 50 | + restore-keys: | |
| 51 | + ${{ runner.os }}-yarn- |
| 52 | + - uses: actions/setup-node@v1 |
| 53 | + with: |
| 54 | + node-version: '12.x' |
| 55 | + registry-url: https://registry.npmjs.org |
| 56 | + |
| 57 | + # build |
| 58 | + - name: install |
| 59 | + run: yarn --frozen-lockfile |
| 60 | + - name: build |
| 61 | + run: yarn build |
| 62 | + - name: package |
| 63 | + run: yarn package |
| 64 | + |
| 65 | + # deploy to npm |
| 66 | + - run: npm publish --access public |
| 67 | + env: |
| 68 | + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 69 | + |
| 70 | + # deploy to new github release |
| 71 | + - name: Create Release |
| 72 | + id: create_release |
| 73 | + uses: actions/create-release@v1 |
| 74 | + env: |
| 75 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 76 | + with: |
| 77 | + tag_name: ${{ github.ref }} |
| 78 | + release_name: Release ${{ github.ref }} |
| 79 | + draft: false |
| 80 | + prerelease: false |
| 81 | + - name: Publish linux binaries as release assets |
| 82 | + id: upload-release-asset |
| 83 | + uses: actions/upload-release-asset@v1 |
| 84 | + env: |
| 85 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 86 | + with: |
| 87 | + 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 |
| 88 | + asset_path: ./exoframe-linux |
| 89 | + asset_name: exoframe-linux |
| 90 | + asset_content_type: application/binary |
| 91 | + - name: Publish macos binaries as release assets |
| 92 | + id: upload-release-asset |
| 93 | + uses: actions/upload-release-asset@v1 |
| 94 | + env: |
| 95 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 96 | + with: |
| 97 | + 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 |
| 98 | + asset_path: ./exoframe-macos |
| 99 | + asset_name: exoframe-macos |
| 100 | + asset_content_type: application/binary |
| 101 | + - name: Publish windows binaries as release assets |
| 102 | + id: upload-release-asset |
| 103 | + uses: actions/upload-release-asset@v1 |
| 104 | + env: |
| 105 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 106 | + with: |
| 107 | + 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 |
| 108 | + asset_path: ./exoframe-win.exe |
| 109 | + asset_name: exoframe-win.exe |
| 110 | + asset_content_type: application/binary |
0 commit comments