Fix Debian package permission. Set version on manual workflow trigger

This commit is contained in:
Debanjum Singh Solanky
2022-08-16 20:26:06 +03:00
parent 4d83a1d13b
commit a37724f338

View File

@@ -2,6 +2,11 @@ name: release
on: on:
workflow_dispatch: workflow_dispatch:
inputs:
version:
description: 'Version Number'
required: true
type: string
push: push:
tags: tags:
- v* - v*
@@ -74,6 +79,8 @@ jobs:
- name: Create Debian Package - name: Create Debian Package
if: matrix.os == 'ubuntu-latest' if: matrix.os == 'ubuntu-latest'
shell: bash shell: bash
env:
DEBIAN_PACKAGE_VERSION: ${{ inputs.version }}
run: | run: |
# Install Debian Packager # Install Debian Packager
gem install fpm gem install fpm
@@ -86,11 +93,13 @@ jobs:
# Fix permissions to be usable by non-root users # Fix permissions to be usable by non-root users
find package/usr/share -type f -exec chmod 644 -- {} + find package/usr/share -type f -exec chmod 644 -- {} +
chmod 644 package/opt/Khoj chmod 755 package/opt/Khoj
# Package the app # Package the app
export DEBIAN_PACKAGE_VER=$(echo $GITHUB_REF_NAME | sed -E 's/v(.*)/\1/g') if [ -z "$DEBIAN_PACKAGE_VERSION" ]; then
fpm -C package -s dir -t deb -n Khoj --version $DEBIAN_PACKAGE_VER -p dist/khoj_"$GITHUB_REF_NAME"_amd64.deb DEBIAN_PACKAGE_VERSION=$(echo $GITHUB_REF_NAME | sed -E 's/v(.*)/\1/g')
fi
fpm -C package -s dir -t deb -n Khoj --version $DEBIAN_PACKAGE_VERSION -p dist/khoj_"$GITHUB_REF_NAME"_amd64.deb
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
with: with: