|
| 1 | +# This is a basic workflow to help you get started with Actions |
| 2 | + |
| 3 | +name: Release |
| 4 | + |
| 5 | +# Controls when the action will run. Triggers the workflow on push or pull request |
| 6 | +# events but only for the master branch |
| 7 | +on: |
| 8 | + push: |
| 9 | + tags: |
| 10 | + - '[0-9]+.[0-9]+.[0-9]+*' |
| 11 | + |
| 12 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 13 | +jobs: |
| 14 | + # This workflow contains a single job called "build" |
| 15 | + build: |
| 16 | + # The type of runner that the job will run on |
| 17 | + runs-on: ubuntu-latest |
| 18 | + |
| 19 | + # Steps represent a sequence of tasks that will be executed as part of the job |
| 20 | + steps: |
| 21 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + |
| 24 | + - name: Install nodejs |
| 25 | + uses: actions/setup-node@v1 |
| 26 | + with: |
| 27 | + node-version: '12.x' |
| 28 | + registry-url: 'https://registry.npmjs.org' |
| 29 | + |
| 30 | + - name: Cache node modules |
| 31 | + uses: actions/cache@v1 |
| 32 | + env: |
| 33 | + cache-name: cache-node-modules |
| 34 | + with: |
| 35 | + path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS |
| 36 | + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} |
| 37 | + restore-keys: | |
| 38 | + ${{ runner.os }}-build-${{ env.cache-name }}- |
| 39 | + ${{ runner.os }}-build- |
| 40 | + ${{ runner.os }}- |
| 41 | +
|
| 42 | + - name: Install node deps |
| 43 | + run: npm ci |
| 44 | + |
| 45 | + - name: Build browser stuff |
| 46 | + run: | |
| 47 | + npm run build-browser |
| 48 | + npm run build-browser-min |
| 49 | + zip dist/fusionauth-typescript-client.zip dist/fusionauth-typescript-client.* |
| 50 | +
|
| 51 | + - name: Create Release |
| 52 | + id: create_release |
| 53 | + uses: actions/create-release@latest |
| 54 | + env: |
| 55 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
| 56 | + with: |
| 57 | + tag_name: ${{ github.ref }} |
| 58 | + release_name: Release ${{ github.ref }} |
| 59 | + body: | |
| 60 | + Released ${{ github.ref }} |
| 61 | + |
| 62 | + See https://fusionauth.io/docs/v1/tech/release-notes for the most recent changes. |
| 63 | + draft: false |
| 64 | + prerelease: false |
| 65 | + |
| 66 | + - name: Upload Release Asset |
| 67 | + id: upload-release-asset |
| 68 | + uses: actions/upload-release-asset@v1 |
| 69 | + env: |
| 70 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 71 | + with: |
| 72 | + 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 |
| 73 | + asset_path: dist/fusionauth-typescript-client.zip |
| 74 | + asset_name: fusionauth-typescript-client.zip |
| 75 | + asset_content_type: application/zip |
0 commit comments