added a couple more currencies and added support to add custom curren… #54
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| release: | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [ubuntu-24.04] | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install dependencies (Ubuntu) | |
| if: matrix.platform == 'ubuntu-24.04' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev | |
| - name: Install frontend dependencies | |
| run: npm install | |
| - name: Verify version matches tag | |
| run: | | |
| TAG_VERSION="${GITHUB_REF#refs/tags/v}" | |
| PKG_VERSION=$(node -p "require('./package.json').version") | |
| if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then | |
| echo "::error::Version mismatch! Tag is v${TAG_VERSION} but package.json has ${PKG_VERSION}" | |
| echo "Update package.json version to ${TAG_VERSION} before tagging." | |
| exit 1 | |
| fi | |
| echo "Version OK: ${PKG_VERSION}" | |
| - name: Build | |
| run: npm run tauri build | |
| - name: Get version from tag | |
| id: get_version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
| - name: Detect built deb filename | |
| id: detect_deb | |
| run: | | |
| DEB_FILE=$(find src-tauri/target/release/bundle/deb -name "*.deb" | head -n 1) | |
| if [ -z "$DEB_FILE" ]; then | |
| echo "::error::No .deb file found in src-tauri/target/release/bundle/deb/" | |
| ls -R src-tauri/target/release/bundle/ | |
| exit 1 | |
| fi | |
| DEB_BASENAME=$(basename "$DEB_FILE") | |
| echo "Found DEB file: $DEB_FILE ($DEB_BASENAME)" | |
| echo "DEB_FILE=$DEB_FILE" >> $GITHUB_OUTPUT | |
| echo "DEB_BASENAME=$DEB_BASENAME" >> $GITHUB_OUTPUT | |
| - name: Update PKGBUILD | |
| run: | | |
| VERSION="${{ steps.get_version.outputs.VERSION }}" | |
| TARBALL_URL="https://github.com/FrogSnot/Spent/archive/v${VERSION}.tar.gz" | |
| TARBALL_SHA=$(curl -sL "$TARBALL_URL" | sha256sum | cut -d' ' -f1) | |
| sed -i "s/pkgver=.*/pkgver=${VERSION}/" AUR/PKGBUILD | |
| sed -i "s/sha256sums=.*/sha256sums=('${TARBALL_SHA}')/" AUR/PKGBUILD | |
| - name: Update PKGBUILD-bin | |
| run: | | |
| VERSION="${{ steps.get_version.outputs.VERSION }}" | |
| DEB_FILE="${{ steps.detect_deb.outputs.DEB_FILE }}" | |
| DEB_BASENAME="${{ steps.detect_deb.outputs.DEB_BASENAME }}" | |
| echo "Using DEB: $DEB_BASENAME" | |
| DEB_SHA=$(sha256sum "$DEB_FILE" | cut -d' ' -f1) | |
| LICENSE_URL="https://raw.githubusercontent.com/FrogSnot/Spent/v${VERSION}/LICENSE" | |
| README_URL="https://raw.githubusercontent.com/FrogSnot/Spent/v${VERSION}/README.md" | |
| LICENSE_SHA=$(curl -sL "$LICENSE_URL" | sha256sum | cut -d' ' -f1) | |
| README_SHA=$(curl -sL "$README_URL" | sha256sum | cut -d' ' -f1) | |
| sed -i "s/pkgver=.*/pkgver=${VERSION}/" AUR/PKGBUILD-bin | |
| sed -i "s|\(releases/download/[^/]*/\).*\.deb\")|\1${DEB_BASENAME}\")|" AUR/PKGBUILD-bin | |
| perl -i -pe "BEGIN{undef $/;} s/sha256sums=\([^)]+\)/sha256sums=('${LICENSE_SHA}'\\n '${README_SHA}')/smg" AUR/PKGBUILD-bin | |
| perl -i -pe "s/sha256sums_x86_64=\([^)]+\)/sha256sums_x86_64=('${DEB_SHA}')/g" AUR/PKGBUILD-bin | |
| mkdir -p release-bin | |
| cp AUR/PKGBUILD-bin release-bin/PKGBUILD | |
| - name: Upload Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| src-tauri/target/release/bundle/deb/*.deb | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish to AUR (spent-bin) | |
| uses: KSXGitHub/github-actions-deploy-aur@v2.7.2 | |
| with: | |
| pkgname: spent-bin | |
| pkgbuild: ./release-bin/PKGBUILD | |
| commit_username: ${{ secrets.AUR_USERNAME }} | |
| commit_email: ${{ secrets.AUR_EMAIL }} | |
| ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
| commit_message: Update to ${{ github.ref_name }} | |
| ssh_keyscan_types: rsa,ecdsa,ed25519 | |
| force_push: true | |
| - name: Publish to AUR (spent) | |
| uses: KSXGitHub/github-actions-deploy-aur@v2.7.2 | |
| with: | |
| pkgname: spent | |
| pkgbuild: ./AUR/PKGBUILD | |
| commit_username: ${{ secrets.AUR_USERNAME }} | |
| commit_email: ${{ secrets.AUR_EMAIL }} | |
| ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} | |
| commit_message: Update to ${{ github.ref_name }} | |
| ssh_keyscan_types: rsa,ecdsa,ed25519 | |
| force_push: true |