Skip to content

Publish new release #17

Publish new release

Publish new release #17

Workflow file for this run

name: 'Publish new release'
# Triggered when pushing to the `release` branch
on:
push:
branches: [release]
workflow_dispatch:
jobs:
create-release:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install frontend dependencies
run: yarn
- name: Lint check
if: matrix.platform == 'ubuntu-latest'
run: yarn lint
- name: Build and publish with tauri
id: create-release
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: 'Emoji Mart v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: false
prerelease: false
# Unfortunately does not return the actual release tag
# outputs:
# releaseId: ${{ steps.create-release.outputs.releaseId }}
publish-flatpak:
needs: create-release
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-44
options: --privileged
steps:
- uses: actions/checkout@v4
with:
repository: flathub/io.github.vemonet.EmojiMart
ref: dev
submodules: 'recursive'
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Update package version in flatpak manifest
# env:
# PACKAGE_VERSION: ${{ needs.create-release.outputs.releaseId }}
run: |
curl -L -o package.json https://raw.github.com/vemonet/EmojiMart/release/package.json
PACKAGE_VERSION=$(node -p "require('./package.json').version")
rm package.json
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
sed -i "s/- --device=dri/- --device=all/g" ./io.github.vemonet.EmojiMart.yml
sed -i "s/tag: v[0-9]*\.[0-9]*\.[0-9]*$/tag: v$PACKAGE_VERSION/g" ./io.github.vemonet.EmojiMart.yml
sed -i "s/<releases>$/<releases>\\n <release version=\"$PACKAGE_VERSION\" date=\"$(date +%Y-%m-%d)\">\\n <\/release>\\n/g" ./io.github.vemonet.EmojiMart.appdata.xml
echo "🏷️ Publishing $PACKAGE_VERSION"
- name: Build flatpak
uses: flatpak/flatpak-github-actions/[email protected]
with:
bundle: EmojiMart.flatpak
manifest-path: io.github.vemonet.EmojiMart.yml
cache-key: flatpak-builder-${{ github.sha }}
- uses: actions/upload-artifact@v3
with:
name: EmojiMart.flatpak
path: EmojiMart.flatpak
- name: Update Release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: |
EmojiMart.flatpak
# EmojiMart-.flatpak
# Tag auto pick from release trigger env
# tag_name: v${{ github.env.PACKAGE_VERSION }}