Skip to content

Commit

Permalink
v0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyagr committed Feb 19, 2024
0 parents commit 43e27ac
Show file tree
Hide file tree
Showing 61 changed files with 21,782 additions and 0 deletions.
148 changes: 148 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
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-20.04
target: x86_64-unknown-linux-musl
- build: macos-x86_64
os: macos-11
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-20.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-web
- name: Build archive
shell: bash
run: |
# TODO: Create a third action to combine both in one archive
outdir="target/${{ matrix.target }}/release"
name="diffedit3-web-${{ github.event.release.tag_name }}-${{ matrix.target }}"
cd "$outdir"
ls # Debug
if [ "${{ matrix.os }}" = "windows-2022" ]; then
7z a "../../../$name.zip" diffedit3-web.exe
echo "ASSET=$name.zip" >> $GITHUB_ENV
else
tar czf "../../../$name.tar.gz" diffedit3-web
echo "ASSET=$name.tar.gz" >> $GITHUB_ENV
fi
- name: Upload release archive
uses: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
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-20.04, windows-latest]
include:
- platform: macos-latest
os: darwin
- platform: ubuntu-20.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-20.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 install

- uses: ilyagr/tauri-action@patch-1
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-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: actions/upload-release-asset@e8f9f06c4b078e705bd2ea027f0926603fc9b4d5
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
67 changes: 67 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: build

on:
push:
branches:
- main
- release
- release-candidate
- ci
pull_request:

permissions: read-all

env:
CARGO_INCREMENTAL: 0
CARGO_PROFILE_DEV_DEBUG: 0

jobs:
check-dist-up-to-date:
name: Check that webapp was compiled
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: setup node
uses: actions/setup-node@v4
with:
node-version: 21

- name: install frontend dependencies
run: npm install

- name: build
run: npm run build

- name: Check for uncommitted changes
shell: bash
# This check might be a bit flaky. If it becomes a problem,
# we could maybe check modification dates instead.
run: |
git add -N . # `git diff` ignores added files without this
# git diff
if git diff --stat --exit-code; then
echo "OK, building the webapp did not cause any changes."
else
echo
echo 'Updates to the webapp were not bundled to webapp/dist/.'
echo 'Please run:'
echo ' rm -r node_modules package-lock.json && npm install && npm run build'
exit 1
fi
clippy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Install Rust
uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8
with:
toolchain: 1.76
components: clippy
- name: install dependencies (ubuntu + Tauri only)
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf
- name: Clippy
run: cargo clippy --workspace --all-targets --verbose
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/target/
node_modules/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
10 changes: 10 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# diffedit3 is (c) the Jujutsu authors, see also
# https://github.com/martinvonz/jj/blob/main/AUTHORS for the most up-to-date version.
#
# This is the list of Jujutsu's significant contributors.
#
# This does not necessarily list everyone who has contributed code,
# especially since many employees of one corporation may be contributing.
# To see the full list of contributors, see the revision history in
# source control.
Google LLC
Loading

0 comments on commit 43e27ac

Please sign in to comment.