git.delta.rocks / jrsonnet / refs/commits / bcbd39795a2d

difftreelog

ci add release

Lach2020-08-25parent: #c49885a.patch.diff
in: master

2 files changed

modified.github/workflows/lints.ymldiffbeforeafterboth
1on: [push, pull_request]1on: [push, pull_request]
22
3name: Quickstart3name: Misc lints
44
5jobs:5jobs:
6 check:6 check:
added.github/workflows/release.ymldiffbeforeafterboth
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,75 @@
+name: CI
+
+on: [push]
+
+jobs:
+  test:
+    name: Test Suite
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout sources
+        uses: actions/checkout@v2
+      - name: Install stable toolchain
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+          override: true
+      - name: Run tests
+        uses: actions-rs/cargo@v1
+        with:
+          command: test
+          args: --all
+  release:
+    if: startsWith(github.ref, 'refs/tags/')
+    needs: [test]
+    strategy:
+      matrix:
+        os: [ubuntu-latest, macOS-latest, windows-latest]
+        include:
+          - os: ubuntu-latest
+            rust: stable
+            target: x86_64-unknown-linux-musl
+            bin: jrsonnet
+            name: jrsonnet-linux-amd64
+          - os: windows-latest
+            rust: stable
+            target: x86_64-pc-windows-msvc
+            bin: jrsonnet.exe
+            name: jrsonnet-windows-amd64.exe
+          - os: macOS-latest
+            rust: stable
+            target: x86_64-apple-darwin
+            bin: jrsonnet
+            name: jrsonnet-darwin-amd64
+    runs-on: ${{ matrix.os }}
+    steps:
+      - name: Install stable toolchain
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: ${{ matrix.rust }}
+          override: true
+          target: ${{ matrix.target }}
+      - name: Checkout
+        uses: actions/checkout@v2
+      - name: Run build
+        uses: actions-rs/cargo@v1
+        with:
+          command: build
+          args: --bin=jrsonnet --release --target ${{ matrix.target }}
+      - name: Package
+        shell: bash
+        run: |
+          strip target/${{ matrix.target }}/release/${{ matrix.bin }}
+          cd target/${{ matrix.target }}/release
+
+          cp ${{ matrix.bin }} ../../../${{ matrix.name }}
+          cd -
+      - name: Generate SHA-256
+        run: shasum -a 256 ${{ matrix.name }} > ${{ matrix.name }}.sha256
+      - name: Publish
+        uses: softprops/action-gh-release@v1
+        with:
+          draft: true
+          files: "jrsonnet*"
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}