|
| 1 | +on: |
| 2 | + push: |
| 3 | + # Sequence of patterns matched against refs/tags |
| 4 | + tags: |
| 5 | + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 |
| 6 | + |
| 7 | +name: Release |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: Upload Release Asset |
| 12 | + runs-on: ubuntu-latest |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + node-version: [18.x] |
| 16 | + steps: |
| 17 | + - name: Checkout code |
| 18 | + uses: actions/checkout@v4 |
| 19 | + with: |
| 20 | + fetch-depth: 0 |
| 21 | + lfs: true |
| 22 | + - name: Checkout LFS objects |
| 23 | + run: git lfs checkout |
| 24 | + |
| 25 | + |
| 26 | + with: |
| 27 | + version: 8.x.x |
| 28 | + - name: Use Node.js ${{ matrix.node-version }} |
| 29 | + uses: actions/setup-node@v3 |
| 30 | + with: |
| 31 | + node-version: ${{ matrix.node-version }} |
| 32 | + cache: 'pnpm' |
| 33 | + - name: Install dependencies |
| 34 | + run: pnpm install |
| 35 | + - name: Build project |
| 36 | + |
| 37 | + run: | |
| 38 | + sh ./ci-release-build.sh |
| 39 | +
|
| 40 | + - name: Create Release |
| 41 | + id: create_release |
| 42 | + uses: actions/create-release@v1 |
| 43 | + env: |
| 44 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 45 | + with: |
| 46 | + tag_name: ${{ github.ref }} |
| 47 | + release_name: Release ${{ github.ref }} |
| 48 | + draft: false |
| 49 | + prerelease: false |
| 50 | + - run: npx changelogithub |
| 51 | + continue-on-error: true |
| 52 | + env: |
| 53 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 54 | + - name: Upload Release Asset |
| 55 | + id: upload-release-asset |
| 56 | + uses: actions/upload-release-asset@v1 |
| 57 | + env: |
| 58 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 59 | + with: |
| 60 | + asset_name: release.zip |
| 61 | + 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 |
| 62 | + asset_path: ./assets/release.zip |
| 63 | + asset_content_type: application/zip |
0 commit comments