Skip to content

Commit

Permalink
Add deb packages release
Browse files Browse the repository at this point in the history
  • Loading branch information
arimatakao committed Jun 28, 2024
1 parent 094c962 commit 01389a2
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/deb_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release deb package

on:
release:
types: [created]

permissions:
contents: write
packages: write

jobs:
linux-release:
name: Release Go Binaries for Linux
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22.4'

- name: Build Go application
run: |
go build -o ./bin/mdx main.go
- name: Create deb package structure
env:
VERSION: ${{ github.event.release.tag_name }}
PACKAGE_NAME: "mdx_${{ github.event.release.tag_name }}_amd64.deb"
run: |
echo "Package: mdx" >> ./control
echo "Version: ${VERSION}" >> ./control
echo "Architecture: amd64" >> ./control
echo "Maintainer: arimatakao" >> ./control
echo "Description: cli manga downloader saves in CBZ PDF EPUB formats" >> ./control
echo "Homepage: https://github.com/arimatakao/mdx" >> ./control
mkdir -p ./debian/mdx/usr/bin
cp ./bin/mdx ./debian/mdx/usr/bin/mdx
chmod +x ./debian/mdx/usr/bin/mdx
- name: Build deb package
run: dpkg-deb --build ./debian/mdx

- name: Set deb package name with version and architecture
run: |
mv ./debian/mdx.deb "./${PACKAGE_NAME}"
- name: Upload deb package to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./mdx_${{ github.event.release.tag_name }}_amd64.deb
asset_name: mdx_${{ github.event.release.tag_name }}_amd64.deb
asset_content_type: application/x-deb
2 changes: 2 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
name: Release Go Binaries in tar.gz

on:
release:
types: [created]
Expand Down

0 comments on commit 01389a2

Please sign in to comment.