Skip to content

Bump tar from 7.5.2 to 7.5.11 #147

Bump tar from 7.5.2 to 7.5.11

Bump tar from 7.5.2 to 7.5.11 #147

Workflow file for this run

name: CI/CD
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
version:
description: "Version to release (e.g., 0.2.6). Leave empty for CI build only."
required: false
type: string
release_notes:
description: "Release notes for AppStream metadata"
required: false
type: string
default: "This release includes stability and performance improvements."
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
IS_RELEASE: ${{ github.event_name == 'workflow_dispatch' && inputs.version != '' }}
BUMPED_CONFIGS: bumped-configs
DEB_ARTIFACT: deb-artifact
RPM_ARTIFACT: rpm-artifact
SNAP_ARTIFACT: snap-artifact
FLATPAK_ARTIFACT: flatpak-artifact
NPM_CONFIG_AUDIT: false
NPM_CONFIG_FUND: false
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: "lts/*"
cache: "npm"
- name: Install frontend dependencies
run: npm ci
- name: Lint frontend
run: npm run lint
# - name: Check formatting
# run: npm run format:check
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri -> target
- name: Check Rust formatting
working-directory: src-tauri
run: cargo fmt --check
- name: Install dependencies
# language=Bash
run: |
sudo apt update
sudo apt install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
xmlstarlet
- name: Lint Rust
working-directory: src-tauri
env:
TODOIST_CLIENT_ID: ${{ secrets.TODOIST_CLIENT_ID }}
TODOIST_CLIENT_SECRET: ${{ secrets.TODOIST_CLIENT_SECRET }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: cargo clippy -- -D warnings
build-core:
needs: lint
permissions:
contents: write
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v6
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: "lts/*"
cache: "npm"
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri -> target
- name: Install dependencies
# language=Bash
run: |
sudo apt update
sudo apt install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
xmlstarlet
- name: Install cargo-edit
if: fromJSON(env.IS_RELEASE)
run: cargo install cargo-edit --locked
- name: Bump version files
if: fromJSON(env.IS_RELEASE)
# language=BASH
run: |
NEW_VERSION="${{ inputs.version }}"
TODAY=$(date +%Y-%m-%d)
echo "Bumping to $NEW_VERSION (date: $TODAY)"
# Package.json
npm version "$NEW_VERSION" --no-git-tag-version --allow-same-version
# Cargo.toml
cd src-tauri && cargo set-version "$NEW_VERSION" && cd ..
# AppStream metainfo
# Add new release tag at the top
xmlstarlet ed -L \
-i "//releases/release[1]" -t elem -n "release_new" \
-i "//release_new" -t attr -n "version" -v "$NEW_VERSION" \
-i "//release_new" -t attr -n "date" -v "$TODAY" \
-s "//release_new" -t elem -n "description" \
-s "//release_new/description" -t elem -n "p" -v "${{ inputs.release_notes }}" \
-r "//release_new" -v "release" \
me.ariyadey.capturist.metainfo.xml
# Keep only top 5 releases
xmlstarlet ed -L -d "//release[position()>5]" me.ariyadey.capturist.metainfo.xml
- name: Install frontend dependencies
run: npm ci
- name: Build
env:
TODOIST_CLIENT_ID: ${{ secrets.TODOIST_CLIENT_ID }}
TODOIST_CLIENT_SECRET: ${{ secrets.TODOIST_CLIENT_SECRET }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: npm run tauri build
- name: Upload DEB Artifact
uses: actions/upload-artifact@v6
with:
name: ${{ env.DEB_ARTIFACT }}
path: src-tauri/target/release/bundle/deb/Capturist_*_amd64.deb
- name: Upload RPM Artifact
if: fromJSON(env.IS_RELEASE)
uses: actions/upload-artifact@v6
with:
name: ${{ env.RPM_ARTIFACT }}
path: src-tauri/target/release/bundle/rpm/Capturist-*.x86_64.rpm
- name: Upload bumped configs
if: fromJSON(env.IS_RELEASE)
uses: actions/upload-artifact@v6
with:
name: ${{ env.BUMPED_CONFIGS }}
path: |
package.json
package-lock.json
src-tauri/Cargo.toml
src-tauri/Cargo.lock
me.ariyadey.capturist.metainfo.xml
build-snap:
needs: build-core
runs-on: ubuntu-latest
outputs:
snap-file: ${{ steps.build.outputs.snap }}
steps:
- uses: actions/checkout@v6
- name: Download bumped configs
if: fromJSON(env.IS_RELEASE)
uses: actions/download-artifact@v7
with:
name: ${{ env.BUMPED_CONFIGS }}
path: .
- name: Download DEB artifact
uses: actions/download-artifact@v7
with:
name: ${{ env.DEB_ARTIFACT }}
path: .
- name: Rename DEB for manifest
run: mv Capturist_*.deb capturist.deb
- name: Build Snap
id: build
uses: snapcore/action-build@v1
- name: Upload Snap artifact
uses: actions/upload-artifact@v6
with:
name: ${{ env.SNAP_ARTIFACT }}
path: ${{ steps.build.outputs.snap }}
build-flatpak:
needs: build-core
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48
options: --privileged
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Download bumped configs
if: fromJSON(env.IS_RELEASE)
uses: actions/download-artifact@v7
with:
name: ${{ env.BUMPED_CONFIGS }}
path: .
- name: Download DEB artifact
uses: actions/download-artifact@v7
with:
name: ${{ env.DEB_ARTIFACT }}
path: .
- name: Rename DEB for manifest
run: mv Capturist_*.deb capturist.deb
- name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: capturist_${{ inputs.version || 'build' }}_amd64.flatpak
manifest-path: me.ariyadey.capturist.yml
- name: Upload Flatpak artifact
uses: actions/upload-artifact@v6
with:
name: ${{ env.FLATPAK_ARTIFACT }}
path: capturist_${{ inputs.version || 'build' }}_amd64.flatpak
release:
needs: [build-core, build-snap, build-flatpak]
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- name: Download bumped configs
if: fromJSON(env.IS_RELEASE)
uses: actions/download-artifact@v7
with:
name: ${{ env.BUMPED_CONFIGS }}
path: .
- name: Configure Git
if: fromJSON(env.IS_RELEASE)
# language=BASH
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit and Push
if: fromJSON(env.IS_RELEASE)
# language=BASH
run: |
git commit -am "Bump version to ${{ inputs.version }}"
git push origin main
- name: Create and Push Tag
if: fromJSON(env.IS_RELEASE)
# language=BASH
run: |
git tag v${{ inputs.version }}
git push origin v${{ inputs.version }}
- name: Download DEB artifact
if: fromJSON(env.IS_RELEASE)
uses: actions/download-artifact@v7
with:
name: ${{ env.DEB_ARTIFACT }}
path: .
- name: Download RPM artifact
if: fromJSON(env.IS_RELEASE)
uses: actions/download-artifact@v7
with:
name: ${{ env.RPM_ARTIFACT }}
path: .
- name: Download Snap artifact
uses: actions/download-artifact@v7
with:
name: ${{ env.SNAP_ARTIFACT }}
path: .
- name: Download Flatpak artifact
if: fromJSON(env.IS_RELEASE)
uses: actions/download-artifact@v7
with:
name: ${{ env.FLATPAK_ARTIFACT }}
path: .
- name: Release to GitHub
if: fromJSON(env.IS_RELEASE)
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ inputs.version }}
draft: true
make_latest: true
files: |
*.deb
*.rpm
*.snap
*.flatpak
fail_on_unmatched_files: true
- name: Publish to Snap Store
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
with:
snap: ${{ needs.build-snap.outputs.snap-file }}
release: ${{ fromJSON(env.IS_RELEASE) && 'beta' || 'edge' }}