Update README.md #39
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: Create new realease | |
on: | |
push: | |
branches: | |
- "**" | |
tags: | |
- "!**" | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- name: Install fuse libfuse2 | |
run: sudo apt install fuse libfuse2 | |
- name: Make Calibre AppDir | |
run: | | |
set -x | |
version=$(grep -o "Calibre:.*" README.md | cut -d ' ' -f2) | |
echo "Calibre version: $version" | |
#rm -rf build/ | |
mkdir -p build/calibre.AppDir/ | |
#cp calibre.desktop build/calibre.AppDir/ | |
cat > build/calibre.AppDir/calibre.desktop << 'EOF' | |
[Desktop Entry] | |
Type=Application | |
Name=Calibre | |
Comment=E-Book Management | |
Exec=calibre %F | |
Icon=calibre | |
MimeType=application/x-mobipocket-ebook;application/epub+zip;x-content/ebook-reader | |
Categories=Office;Graphics;Viewer | |
EOF | |
chmod +x build/calibre.AppDir/calibre.desktop | |
curl --location -o build/calibre.AppDir/AppRun https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-x86_64 | |
chmod +x build/calibre.AppDir/AppRun | |
mkdir -p build/calibre.AppDir/usr/bin/ | |
cd build/calibre.AppDir/usr/bin/ | |
curl -o - https://download.calibre-ebook.com/$version/calibre-$version-x86_64.txz | tar -xJf - | |
pwd | |
ls -lah | |
cd ../../../../ | |
pwd | |
ls -lah | |
cp build/calibre.AppDir/usr/bin/resources/content-server/calibre.png build/calibre.AppDir | |
cp README.md build/calibre.AppDir | |
- name: Get appimagetool | |
run: | | |
set -x | |
wget https://github.com/AppImage/AppImageKit/releases/download/13/appimagetool-x86_64.AppImage | |
chmod +x appimagetool-x86_64.AppImage | |
- name: Make AppImage | |
run: | | |
set -x | |
./appimagetool-x86_64.AppImage build/calibre.AppDir | |
- name: List files and rename AppImage | |
run: | | |
set -x | |
pwd | |
ls -lah | |
version=$(grep -o "Calibre:.*" README.md | cut -d ' ' -f2) | |
echo "Calibre version: $version" | |
mv Calibre-x86_64.AppImage "Calibre-$version-x86_64-1_JB.AppImage" | |
md5sum "Calibre-$version-x86_64-1_JB.AppImage" > "Calibre-$version-x86_64-1_JB.AppImage.md5" | |
ls -lah | |
# Build - Errror: Resource not accessible by integration | |
# Change Settings -> Actions -> General -> Workflow Permissions to allow read and write: | |
# https://github.com/actions/first-interaction/issues/10#issuecomment-1506118886 | |
# https://github.com/marketplace/actions/upload-to-github-release | |
- uses: xresloader/upload-to-github-release@main | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
file: "Calibre*.AppImage; Calibre*.md5" | |
#delete_file: "random-name-*.txt;random-*.txt" | |
release_id: ${{ steps.create_release.outputs.id }} | |
#overwrite: true | |
verbose: true | |
#tags: true | |
draft: false | |
default_release_name: "Calibre V in AppImage" |