Skip to content

v0.5.0

v0.5.0 #22

Workflow file for this run

name: Release
on:
release:
types: [created]
permissions: read-all
env:
CARGO_INCREMENTAL: 0
jobs:
publish-web:
name: build-release
permissions:
contents: write
strategy:
fail-fast: false
matrix:
build: [linux-musl, macos-x86_64, macos-aarch64, win-msvc]
include:
- build: linux-musl
os: ubuntu-22.04
target: x86_64-unknown-linux-musl
- build: macos-x86_64
os: macos-13
target: x86_64-apple-darwin
- build: macos-aarch64
os: macos-14
target: aarch64-apple-darwin
- build: win-msvc
os: windows-2022
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
# - name: Install packages (Ubuntu)
# if: matrix.os == 'ubuntu-22.04'
# run: |
# sudo apt-get update
# sudo apt-get install -y --no-install-recommends xz-utils liblz4-tool musl-tools
- name: Install Rust
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Build release binary
run: cargo build --target ${{ matrix.target }} --verbose --release -p diffedit3
- name: Build archive
shell: bash
run: |
# TODO: Create a third action to combine both in one archive
outdir="target/${{ matrix.target }}/release"
name="diffedit3-${{ github.event.release.tag_name }}-${{ matrix.target }}"
cd "$outdir"
ls # Debug
if [ "${{ matrix.os }}" = "windows-2022" ]; then
7z a "../../../$name.zip" diffedit3.exe
echo "ASSET=$name.zip" >> $GITHUB_ENV
else
tar czf "../../../$name.tar.gz" diffedit3
echo "ASSET=$name.tar.gz" >> $GITHUB_ENV
fi
- name: Upload release archive
uses: shogo82148/actions-upload-release-asset@aac270e08f6b4547ada0b3800f88e1eb3ce9d400 # v1.7.7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream
publish-tauri:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
# TODO: Make this more consistent with the other binary
platform: [macos-latest, ubuntu-22.04, windows-latest]
include:
- platform: macos-latest
os: darwin
- platform: ubuntu-22.04
os: linux # TODO: musl?
- platform: windows-latest
os: windows-2022
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 21
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
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: npm clean-install
- uses: tauri-apps/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Will publish a release manually
# with:
# tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
# releaseName: "App v__VERSION__"
# releaseBody: "See the assets to download this version and install."
# releaseDraft: true
# prerelease: false
- name: Build archive
shell: bash
run: |
# TODO: Create a third action to combine both in one archive
outdir="target/release"
name="diffedit3-unsupported-tauri-gui-${{ github.event.release.tag_name }}-${{ matrix.os }}"
cd "$outdir"
ls # Debug
if [ "${{ matrix.os }}" = "windows-2022" ]; then
7z a "../../$name.zip" diffedit3-gui.exe
echo "ASSET=$name.zip" >> $GITHUB_ENV
else
tar czf "../../$name.tar.gz" diffedit3-gui
echo "ASSET=$name.tar.gz" >> $GITHUB_ENV
fi
cd ../..
ls
- name: Upload release archive
uses: shogo82148/actions-upload-release-asset@aac270e08f6b4547ada0b3800f88e1eb3ce9d400 # v1.7.7
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.ASSET }}
asset_name: ${{ env.ASSET }}
asset_content_type: application/octet-stream