v1.10.4 #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
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: | | |
VERSION=$(echo "${{ github.event.release.tag_name }}" | cut -c 2-) | |
PACKAGE_NAME="mdx_${{ github.event.release.tag_name }}_amd64.deb" | |
mkdir -p ./debian/mdx/DEBIAN | |
echo "Package: mdx" >> ./debian/mdx/DEBIAN/control | |
echo "Version: ${VERSION}" >> ./debian/mdx/DEBIAN/control | |
echo "Architecture: amd64" >> ./debian/mdx/DEBIAN/control | |
echo "Maintainer: arimatakao" >> ./debian/mdx/DEBIAN/control | |
echo "Description: cli manga downloader saves in CBZ PDF EPUB formats" >> ./debian/mdx/DEBIAN/control | |
echo "Homepage: https://github.com/arimatakao/mdx" >> ./debian/mdx/DEBIAN/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 | |