[release] changed url for generate source file #36
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 Build | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths-ignore: | |
| - '**.md' | |
| - '.gitignore' | |
| workflow_dispatch: | |
| jobs: | |
| check-release: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| should_release: ${{ steps.check.outputs.should_release }} | |
| version: ${{ steps.check.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 | |
| - name: Check for [release] in commit message | |
| id: check | |
| run: | | |
| COMMIT_MSG=$(git log -1 --pretty=%B) | |
| if echo "$COMMIT_MSG" | grep -q "\[release\]"; then | |
| echo "should_release=true" >> $GITHUB_OUTPUT | |
| # Extract version from package.json | |
| VERSION=$(grep -oP '"version":\s*"\K[^"]+' package.json) | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Release triggered with version $VERSION" | |
| else | |
| echo "should_release=false" >> $GITHUB_OUTPUT | |
| echo "No [release] tag found in commit message" | |
| fi | |
| build-deb: | |
| needs: check-release | |
| if: needs.check-release.outputs.should_release == 'true' | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| libwebkit2gtk-4.1-dev \ | |
| build-essential \ | |
| curl \ | |
| wget \ | |
| file \ | |
| libxdo-dev \ | |
| libssl-dev \ | |
| libayatana-appindicator3-dev \ | |
| librsvg2-dev | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Build Tauri .deb | |
| run: npm run tauri build -- --bundles deb | |
| - name: Rename .deb file | |
| run: | | |
| VERSION="${{ needs.check-release.outputs.version }}" | |
| DEB_FILE=$(find src-tauri/target/release/bundle/deb -name "*.deb" -type f) | |
| mv "$DEB_FILE" "Klia-Store-${VERSION}.deb" | |
| - name: Upload .deb artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: deb-package | |
| path: Klia-Store-*.deb | |
| build-flatpak: | |
| needs: check-release | |
| if: needs.check-release.outputs.should_release == 'true' | |
| runs-on: ubuntu-22.04 | |
| container: | |
| image: bilelmoussaoui/flatpak-github-actions:gnome-47 | |
| options: --privileged | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Flatpak | |
| uses: flatpak/flatpak-github-actions/flatpak-builder@v6 | |
| with: | |
| bundle: Klia-Store-${{ needs.check-release.outputs.version }}.flatpak | |
| manifest-path: io.github.N3kosempai.klia-store.yml | |
| cache-key: flatpak-builder-${{ github.sha }} | |
| - name: Upload Flatpak artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: flatpak-package | |
| path: Klia-Store-*.flatpak | |
| create-release: | |
| needs: [check-release, build-deb, build-flatpak] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download .deb artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: deb-package | |
| - name: Download Flatpak artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: flatpak-package | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ needs.check-release.outputs.version }} | |
| name: Klia Store ${{ needs.check-release.outputs.version }} | |
| draft: false | |
| prerelease: false | |
| body: | | |
| ## Klia Store ${{ needs.check-release.outputs.version }} | |
| ### Installation | |
| **Debian/Ubuntu (.deb):** | |
| ```bash | |
| sudo dpkg -i Klia-Store-${{ needs.check-release.outputs.version }}.deb | |
| ``` | |
| **Flatpak:** | |
| ```bash | |
| flatpak install Klia-Store-${{ needs.check-release.outputs.version }}.flatpak | |
| flatpak run io.github.N3kosempai.klia-store | |
| ``` | |
| ### Changes | |
| ${{ github.event.head_commit.message }} | |
| files: | | |
| Klia-Store-*.deb | |
| Klia-Store-*.flatpak |