Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate deb package on release #94 #324

Merged
merged 2 commits into from
Nov 5, 2022

Conversation

Marwanmhks
Copy link
Contributor

@Marwanmhks Marwanmhks commented Oct 16, 2022

Closes #94

This was referenced Oct 16, 2022
@fujiapple852
Copy link
Owner

fujiapple852 commented Oct 18, 2022

@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.

@Marwanmhks
Copy link
Contributor Author

okay let me check it out and get back to you

@Marwanmhks
Copy link
Contributor Author

Marwanmhks commented Nov 4, 2022

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.

@fujiapple852
Copy link
Owner

@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/upload-release-asset@v1.0.1
        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.

@Marwanmhks Marwanmhks reopened this Nov 5, 2022
@fujiapple852 fujiapple852 merged commit df6b358 into fujiapple852:master Nov 5, 2022
@fujiapple852
Copy link
Owner

Merged, thank you for your contribution @Marwanmhks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate deb package on release
2 participants