Skip to content

Commit

Permalink
add arch linux binary support
Browse files Browse the repository at this point in the history
  • Loading branch information
0-don committed Dec 6, 2023
1 parent bce199a commit 0e02838
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 7 deletions.
67 changes: 64 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,35 @@ concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
setup:
runs-on: ubuntu-latest
outputs:
package_name: ${{ steps.get-package.outputs.name }}
package_version: ${{ steps.get-package.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 20
- name: get package info
id: get-package
run: |
echo "::set-output name=name::$(node -p "require('./package.json').name")"
echo "::set-output name=version::$(node -p "require('./package.json').version")"
create-release:
permissions:
contents: write
runs-on: ubuntu-latest
outputs:
release_id: ${{ steps.create-release.outputs.result }}

steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- name: get version
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV
- name: create release
Expand Down Expand Up @@ -49,12 +65,19 @@ jobs:
platform: [macos-latest, ubuntu-latest, windows-latest]

runs-on: ${{ matrix.platform }}
env:
REPO_OWNER: ${{ github.repository_owner }}
REPO_NAME: ${{ github.repository }}
PACKAGE_NAME: ${{ needs.setup.outputs.package_name }}
PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }}
BINARY_PATH: ./src-tauri/target/release/${{ needs.setup.outputs.package_name }}
steps:

- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v3
with:
node-version: 18
node-version: 20
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install dependencies (ubuntu only)
Expand All @@ -64,14 +87,52 @@ jobs:
wget http://nz2.archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb
sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb
sudo apt-get install -y openssl libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf libxcb-shape0-dev libxcb-xfixes0-dev libxdo-dev
- name: install frontend dependencies
run: yarn install

- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
releaseId: ${{ needs.create-release.outputs.release_id }}

- name: Create PKGBUILD
if: matrix.platform == 'ubuntu-latest'
run: |
cat <<EOF > PKGBUILD
pkgname=${{ env.PACKAGE_NAME }}
pkgver=${{ env.PACKAGE_VERSION }}
pkgrel=1
pkgdesc="Your package description"
arch=('x86_64')
license=('GPL')
source=("${{ env.BINARY_PATH }}")
sha256sums=('SKIP')
package() {
install -Dm755 "\$srcdir/$(basename ${{ env.BINARY_PATH }})" "\$pkgdir/usr/bin/${{ env.PACKAGE_NAME }}"
}
EOF

- name: Build binary with PKGBUILD
if: matrix.platform == 'ubuntu-latest'
uses: 2m/arch-pkgbuild-builder
with:
debug: true
target: pkgbuild
pkgname: "."

- name: Upload Zstandard package to Release
if: matrix.platform == 'ubuntu-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./${{ env.PACKAGE_NAME }}-${{ env.PACKAGE_VERSION }}-x86_64.pkg.tar.zst
asset_name: ${{ env.PACKAGE_NAME }}-${{ env.PACKAGE_VERSION }}-x86_64.pkg.tar.zst
tag: ${{ github.ref }}
overwrite: true

publish-release:
permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "clippy",
"version": "1.2.0",
"version": "1.2.1",
"private": true,
"scripts": {
"start": "vite",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "1.2.0"
version = "1.2.1"
description = "Clipboard Manager built with Rust & Typescript"
authors = ["Don-Cryptus"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "clippy",
"version": "1.2.0"
"version": "1.2.1"
},
"tauri": {
"allowlist": {
Expand Down

0 comments on commit 0e02838

Please sign in to comment.