From addcd8005145076d3be50f1039e6c9d9d07e2b46 Mon Sep 17 00:00:00 2001 From: kojix2 <2xijok@gmail.com> Date: Wed, 26 Oct 2022 17:06:54 +0900 Subject: [PATCH] ci: Create a deb package on every push (#4) --- .github/workflows/build.yml | 29 ---------------------- .github/workflows/ci.yml | 49 +++++++++++++++++++++++++------------ 2 files changed, 34 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 0ef250e..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: build - -on: - push: - tags: - - "v*.*.*" - -jobs: - release: - name: Release - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ 'ubuntu-20.04' ] - steps: - - uses: actions/checkout@v3 - - uses: crystal-lang/install-crystal@v1 - - run: sudo apt -qy install libhts-dev checkinstall - - run: shards install - - run: make - - run: sudo checkinstall --pkgname=bam-filter - --pkgversion=$(echo ${{ github.ref }} | sed -e "s#refs/tags/v##g") - --maintainer=2xijok@gmail.com - --requires=libhts-dev,libc6,libpcre3,libevent-dev,libgc-dev - --nodoc -y - - uses: softprops/action-gh-release@v1 - with: - files: "bam-filter*.deb" - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e6ee86..dd55e1f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,20 +1,39 @@ +name: ci + on: push: pull_request: - branches: [master] + workflow_dispatch: + jobs: - build: - runs-on: ubuntu-latest + release: + name: Release + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04, ubuntu-22.04] steps: - - name: Download source - uses: actions/checkout@v2 - - name: Install Crystal - uses: crystal-lang/install-crystal@v1 - - name: Install htslib-dev - run: sudo apt -qy install libhts-dev - - name: Install shards - run: shards install - - name: Make - run: make - - name: Run tests - run: ./test.sh + - uses: actions/checkout@v3 + - uses: crystal-lang/install-crystal@v1 + - run: sudo apt -qy install libhts-dev checkinstall + - run: shards install + - run: make + - run: bash test.sh + - run: sudo checkinstall --pkgname=bam-filter + --pkgversion=$(echo ${{ github.ref }} | sed -e "s#refs/tags/v##g") + --maintainer=2xijok@gmail.com + --requires=libhts-dev,libc6,libpcre3,libevent-dev,libgc-dev + --nodoc -y + - run: mv bam-filter*.deb bam-filter_${{ matrix.os }}_amd64.deb + - uses: actions/upload-artifact@v3 + with: + name: bam-filter_${{ matrix.os }}_amd64.deb + path: bam-filter_${{ matrix.os }}_amd64.deb + - uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + draft: true + files: | + bam-filter_${{ matrix.os }}_amd64.deb +