trippy icon indicating copy to clipboard operation
trippy copied to clipboard

Generate deb package on release #94

Open Marwanmhks opened this issue 1 year ago • 2 comments

Marwanmhks avatar Oct 16 '22 14:10 Marwanmhks

@Marwanmhks are you able to try this out on your fork? It’s tricky to iterate on it in this repo as it’ll only work from master and will create spurious releases as we test. Adding a tag like 1.2.3 on your fork should trigger the release action.

Thanks again for helping with this.

fujiapple852 avatar Oct 18 '22 11:10 fujiapple852

okay let me check it out and get back to you

Marwanmhks avatar Oct 26 '22 08:10 Marwanmhks

Okay so I was able to automate the deb packaging upon release but I am having a problem with the artifact upload, I would appreciate any hints.

Marwanmhks avatar Nov 04 '22 17:11 Marwanmhks

@Marwanmhks I think you almost had it, nice work.

I had a try on a fork (see here) and was able to get it working with the following:

      - name: Build Debian package
        if: startsWith(matrix.build, 'linux-gnu')
        run: |
          cargo install cargo-deb
          cargo deb --target ${{ matrix.target }} --deb-version ${{ needs.create-release.outputs.trip_version }}
          case ${{ matrix.target }} in
            aarch64-*-linux-*) DPKG_ARCH=arm64 ;;
            arm-*-linux-*hf) DPKG_ARCH=armhf ;;
            i686-*-linux-*) DPKG_ARCH=i686 ;;
            x86_64-*-linux-*) DPKG_ARCH=amd64 ;;
            *) DPKG_ARCH=notset ;;
          esac;
          echo "DPKG_ARCH=${DPKG_ARCH}" >> $GITHUB_ENV
          
      - name: Upload assets to Github
        if: startsWith(matrix.build, 'linux-gnu')
        uses: actions/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ needs.create-release.outputs.upload_url }}
          asset_content_type: application/vnd.debian.binary-package
          asset_path: target/${{ matrix.target }}/debian/trippy_${{ needs.create-release.outputs.trip_version }}_${{ env.DPKG_ARCH }}.deb
          asset_name: trippy_${{ matrix.target }}_${{ needs.create-release.outputs.trip_version }}_${{ env.DPKG_ARCH }}.deb

If you can update the PR based on this (and squash it down to a single commit) then we should be good to merge it.

fujiapple852 avatar Nov 05 '22 03:11 fujiapple852

Merged, thank you for your contribution @Marwanmhks !

fujiapple852 avatar Nov 05 '22 08:11 fujiapple852