|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - 'v*' # Push events to matching v*, i.e. v1.0, v2.1.3 |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - uses: actions/checkout@v2 |
| 13 | + - uses: actions/setup-node@v1 |
| 14 | + with: |
| 15 | + node-version: 12 |
| 16 | + # libgbm-dev is required by Puppeteer 3+ |
| 17 | + - name: Install system dependencies |
| 18 | + run: | |
| 19 | + sudo apt-get install -y libgbm-dev |
| 20 | + - name: Install dependencies |
| 21 | + run: | |
| 22 | + npm ci |
| 23 | + npm ci --prefix packages/core |
| 24 | + - name: Lint, build and test |
| 25 | + env: |
| 26 | + ASCIIDOCTOR_CORE_VERSION: v2.0.10 |
| 27 | + run: | |
| 28 | + npm run lint |
| 29 | + npm run test |
| 30 | + npm run travis --prefix packages/core |
| 31 | + publish: |
| 32 | + needs: build |
| 33 | + runs-on: ubuntu-latest |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v2 |
| 36 | + - uses: actions/setup-node@v1 |
| 37 | + with: |
| 38 | + node-version: 12 |
| 39 | + registry-url: https://registry.npmjs.org/ |
| 40 | + # libgbm-dev is required by Puppeteer 3+ |
| 41 | + - name: Install system dependencies |
| 42 | + run: | |
| 43 | + sudo apt-get install -y libgbm-dev |
| 44 | + # install dependencies |
| 45 | + - name: Install dependencies |
| 46 | + run: | |
| 47 | + npm ci |
| 48 | + npm ci --prefix packages/core |
| 49 | + # package and publish |
| 50 | + - name: Package and publish |
| 51 | + env: |
| 52 | + NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| 53 | + run: | |
| 54 | + ./scripts/package.sh |
| 55 | + ./scripts/publish.sh |
| 56 | + ./scripts/binaries.sh |
| 57 | + # create the GitHub release |
| 58 | + - name: Create release |
| 59 | + id: create_release |
| 60 | + |
| 61 | + env: |
| 62 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + with: |
| 64 | + tag_name: ${{ github.ref }} |
| 65 | + release_name: ${{ github.ref }} |
| 66 | + draft: false |
| 67 | + prerelease: false |
| 68 | + # upload assets |
| 69 | + - name: Upload source code as a zip file |
| 70 | + |
| 71 | + env: |
| 72 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 73 | + with: |
| 74 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 75 | + asset_path: packages/core/bin/asciidoctor.js.dist.zip |
| 76 | + asset_name: asciidoctor.js.dist.zip |
| 77 | + asset_content_type: application/zip |
| 78 | + - name: Upload source code as a tar.gz file |
| 79 | + |
| 80 | + env: |
| 81 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 82 | + with: |
| 83 | + upload_url: ${{ steps.create_release.outputs.upload_url }} |
| 84 | + asset_path: packages/core/bin/asciidoctor.js.dist.tar.gz |
| 85 | + asset_name: asciidoctor.js.dist.tar.gz |
| 86 | + asset_content_type: application/tar+gzip |
0 commit comments