|
| 1 | +name: "Create Tagged Release" |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + |
| 8 | +jobs: |
| 9 | + gh_tagged_release: |
| 10 | + name: Create tagged release |
| 11 | + runs-on: ubuntu-latest |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Checkout project |
| 15 | + uses: actions/checkout@v3 |
| 16 | + |
| 17 | + - name: Cache node modules |
| 18 | + uses: actions/cache@v3 |
| 19 | + env: |
| 20 | + cache-name: cache-node-modules |
| 21 | + with: |
| 22 | + path: ~/.npm |
| 23 | + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} |
| 24 | + restore-keys: | |
| 25 | + ${{ runner.os }}-${{ env.cache-name }}- |
| 26 | + ${{ runner.os }}- |
| 27 | +
|
| 28 | + - name: Setup NodeJs |
| 29 | + uses: actions/setup-node@v3 |
| 30 | + with: |
| 31 | + node-version: '17' |
| 32 | + cache: 'npm' |
| 33 | + cache-dependency-path: '**/package-lock.json' |
| 34 | + |
| 35 | + - name: Set tag version |
| 36 | + run: | |
| 37 | + echo "tagVersion=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV |
| 38 | + yq eval -i '.version = "${{ env.tagVersion }}"' documentation/js-sdk-guide/antora.yml |
| 39 | +
|
| 40 | + - name: Install Dependencies |
| 41 | + run: npm install |
| 42 | + |
| 43 | + - name: Build Project |
| 44 | + run: npm run build |
| 45 | + |
| 46 | + # This should be removed as soon as we go towards nodejs package repository |
| 47 | + - name: Pack Project as tgz |
| 48 | + run: npm pack |
| 49 | + |
| 50 | + - name: Create GitHub release |
| 51 | + if: ${{ (!contains( github.ref, '-rc' )) }} |
| 52 | + uses: svenstaro/upload-release-action@latest |
| 53 | + with: |
| 54 | + overwrite: true |
| 55 | + prerelease: false |
| 56 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 57 | + file: esmf-semantic-ui-schematics-${{ env.tagVersion }}.tgz |
| 58 | + tag: ${{ github.ref }} |
| 59 | + |
| 60 | + - name: Create GitHub pre-release |
| 61 | + if: ${{ (contains( github.ref, '-rc' )) }} |
| 62 | + uses: svenstaro/upload-release-action@latest |
| 63 | + with: |
| 64 | + overwrite: true |
| 65 | + prerelease: true |
| 66 | + repo_token: ${{ secrets.GITHUB_TOKEN }} |
| 67 | + file: esmf-semantic-ui-schematics-${{ env.tagVersion }}.tgz |
| 68 | + tag: ${{ github.ref }} |
0 commit comments