Skip to content

Commit

Permalink
chore(pkg): fix build for git
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-online committed Apr 12, 2023
1 parent 37ead97 commit 67372ba
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/continuous-delivery-git.yml
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v3.5.0

- name: Build PKBUILD
- name: Build PKGBUILD
run: ./scripts/base.sh

- name: Publish AUR package
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/continuous-delivery.yml
Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Build Tauri App
run: yarn tauri build

- name: Build PKBUILD
- name: Build PKGBUILD
run: ./scripts/build.sh

- name: Upload release asset
Expand Down
28 changes: 14 additions & 14 deletions scripts/base.sh
Expand Up @@ -15,11 +15,9 @@ mkdir -p $build_dir
source_url="https://github.com/dan-online/parrot/archive/$full_commit_id.tar.gz"
sha256sums="$(curl -sSL "$source_url" | sha256sum | cut -d' ' -f1)"

echo "Downloading $source_url"
echo "sha256sums: $sha256sums"

# extract package attributes
productName="parrot"
productTitle="Parrot"
pkgver="$(jq -r '.package.version' < "$conf_json")"
pkgdesc="$(jq -r '.tauri.bundle.longDescription' < "$conf_json")"

Expand All @@ -40,39 +38,41 @@ source=("\$pkgname-\$pkgver.tar.gz::$source_url")
sha256sums=('${sha256sums}')
prepare() {
cd "\$pkgname-\$pkgver"
cd "$productName-$full_commit_id"
export YARN_CACHE_FOLDER="\$srcdir/yarn-cache"
yarn install
sed -i "s/\"productName\": \"$productTitle\"/\"productName\": \"$productTitle ($commit_id)\"/" "$conf_json"
cd src-tauri
export RUSTUP_TOOLCHAIN=stable
cargo fetch --target "\$CARCH-unknown-linux-gnu"
}
build() {
cd "\$pkgname-\$pkgver"
cd "$productName-$full_commit_id"
export YARN_CACHE_FOLDER="\$srcdir/yarn-cache"
export RUSTUP_TOOLCHAIN=stable
yarn build
yarn tauri build
}
package() {
cd "\$pkgname-\$pkgver"
install -Dm755 "src-tauri/target/release/\$pkgname" -t "\$pkgdir/usr/bin/"
cd "$productName-$full_commit_id"
install -Dm755 "src-tauri/target/release/$productName-$commit_id" -t "\$pkgdir/usr/bin/"
for i in 32x32 128x128 128x128@2x; do
install -Dm644 src-tauri/icons/\${i}.png \
"\$pkgdir/usr/share/icons/hicolor/\${i}/apps/\$pkgname.png"
"\$pkgdir/usr/share/icons/hicolor/\${i}/apps/$productName.png"
done
install -Dm644 "src-tauri/target/release/bundle/deb/\${pkgname}_\${pkgver}_amd64/data/usr/share/icons/hicolor/256x256@2/apps/\$pkgname.png" -t \
"\$pkgdir/usr/share/icons/hicolor/256x256@2/apps/\$pkgname.png"
install -Dm644 "src-tauri/target/release/bundle/deb/${productName}-${commit_id}_${pkgver}_amd64/data/usr/share/icons/hicolor/256x256@2/apps/${productName}-${commit_id}.png" -t \
"\$pkgdir/usr/share/icons/hicolor/256x256@2/apps/$productName.png"
install -Dm644 src-tauri/icons/icon.png \
"\$pkgdir/usr/share/icons/hicolor/512x512/apps/\$pkgname.png"
"\$pkgdir/usr/share/icons/hicolor/512x512/apps/$productName.png"
install -Dm644 "src-tauri/target/release/bundle/deb/\${pkgname}_\${pkgver}_amd64/data/usr/share/applications/\$pkgname.desktop" -t \
install -Dm644 "src-tauri/target/release/bundle/deb/${productName}-${commit_id}_${pkgver}_amd64/data/usr/share/applications/${productName}-${commit_id}.desktop" -t \
"\$pkgdir/usr/share/applications/"
install -Dm644 LICENSE -t "\$pkgdir/usr/share/licenses/\$pkgname/"
install -Dm644 LICENSE -t "\$pkgdir/usr/share/licenses/${productName}-${commit_id}/"
}
EOF

0 comments on commit 67372ba

Please sign in to comment.