|
| 1 | +--- |
| 2 | +name: Release |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [ master, alpha, beta ] |
| 7 | + |
| 8 | +jobs: |
| 9 | + build-linux-gnu: |
| 10 | + runs-on: ubuntu-latest |
| 11 | + steps: |
| 12 | + - name: Checkout |
| 13 | + uses: actions/checkout@v2 |
| 14 | + |
| 15 | + - name: Install GNU/Linux toolchain |
| 16 | + uses: actions-rs/toolchain@v1 |
| 17 | + with: |
| 18 | + profile: minimal |
| 19 | + toolchain: stable |
| 20 | + target: x86_64-unknown-linux-gnu |
| 21 | + |
| 22 | + - name: Build GNU/Linux |
| 23 | + uses: actions-rs/cargo@v1 |
| 24 | + with: |
| 25 | + command: build |
| 26 | + args: --release --target x86_64-unknown-linux-gnu |
| 27 | + |
| 28 | + - name: Prepare GNU/Linux artifacts |
| 29 | + run: | |
| 30 | + mkdir -p dist builds/typescript-tools-linux |
| 31 | + cp target/x86_64-unknown-linux-gnu/release/rust_typescript_tools builds/typescript-tools-linux-gnu |
| 32 | + tar -C builds -czvf dist/typescript-tools-linux-gnu.tar.gz typescript-tools-linux-gnu |
| 33 | +
|
| 34 | + - name: Upload GNU/Linux artifact |
| 35 | + uses: actions/upload-artifact@v2 |
| 36 | + with: |
| 37 | + name: x86_64-unknown-linux-gnu |
| 38 | + path: dist/typescript-tools-linux-gnu.tar.gz |
| 39 | + |
| 40 | + build-darwin: |
| 41 | + runs-on: macos-11 |
| 42 | + steps: |
| 43 | + - name: Checkout |
| 44 | + uses: actions/checkout@v2 |
| 45 | + |
| 46 | + - name: Install Mac OS toolchain |
| 47 | + uses: actions-rs/toolchain@v1 |
| 48 | + with: |
| 49 | + profile: minimal |
| 50 | + toolchain: stable |
| 51 | + target: x86_64-apple-darwin |
| 52 | + |
| 53 | + - name: Build Mac OS |
| 54 | + uses: actions-rs/cargo@v1 |
| 55 | + with: |
| 56 | + command: build |
| 57 | + args: --release --target x86_64-apple-darwin |
| 58 | + |
| 59 | + - name: Prepare Mac OS artifacts |
| 60 | + run: | |
| 61 | + mkdir -p dist builds/typescript-tools-apple-darwin |
| 62 | + cp target/x86_64-apple-darwin/release/rust_typescript_tools builds/typescript-tools-apple-darwin |
| 63 | + tar -C builds -czvf dist/typescript-tools-apple-darwin.tar.gz typescript-tools-apple-darwin |
| 64 | +
|
| 65 | + - name: Upload Mac OS artifact |
| 66 | + uses: actions/upload-artifact@v2 |
| 67 | + with: |
| 68 | + name: x86_64-apple-darwin |
| 69 | + path: dist/typescript-tools-apple-darwin.tar.gz |
| 70 | + |
| 71 | + release: |
| 72 | + needs: [ build-linux-gnu, build-darwin ] |
| 73 | + runs-on: ubuntu-latest |
| 74 | + steps: |
| 75 | + - name: Checkout |
| 76 | + uses: actions/checkout@v2 |
| 77 | + |
| 78 | + - name: Download GNU/Linux artifact |
| 79 | + uses: actions/download-artifact@v2 |
| 80 | + with: |
| 81 | + name: x86_64-unknown-linux-gnu |
| 82 | + path: dist/typescript-tools-linux-gnu.tar.gz |
| 83 | + |
| 84 | + - name: Download Mac OS artifact |
| 85 | + uses: actions/download-artifact@v2 |
| 86 | + with: |
| 87 | + name: x86_64-apple-darwin |
| 88 | + path: dist/typescript-tools-apple-darwin.tar.gz |
| 89 | + |
| 90 | + - name: Install release dependencies |
| 91 | + env: |
| 92 | + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }} |
| 93 | + run: | |
| 94 | + npm install |
| 95 | + npx semantic-release |
| 96 | +
|
0 commit comments