diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8991078..4db11df 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,10 @@ -name: Publish +name: Release on: push: tags: - 'v*' workflow_dispatch: -env: - CARGO_TERM_COLOR: always - jobs: release: strategy: @@ -22,7 +19,7 @@ jobs: - name: Node.js setup uses: actions/setup-node@v1 with: - node-version: 14 + node-version: 16 - name: Rust setup uses: actions-rs/toolchain@v1 @@ -37,13 +34,11 @@ jobs: - run: npm install - - run: npm run build - - - uses: tauri-apps/tauri-action@v0 + - name: Build and release + uses: tauri-apps/tauri-action@b3f03835ca527e9735b386f1b1302ca70714b1e6 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tagName: ${{ github.ref_name }} - releaseName: ${{ github.ref_name }} + tagName: v__VERSION__ + releaseName: v__VERSION__ releaseDraft: true - prerelease: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4d811c..7ad1dd0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,16 +3,9 @@ on: push: branches: - '*' - tags-ignore: - - '*' pull_request: - branches: - - '*' workflow_dispatch: -env: - CARGO_TERM_COLOR: always - jobs: test: strategy: @@ -27,34 +20,34 @@ jobs: - name: Node.js setup uses: actions/setup-node@v1 with: - node-version: 14 + node-version: 16 - name: Rust setup uses: actions-rs/toolchain@v1 with: toolchain: stable + - name: Rust Cache + uses: Swatinem/rust-cache@v1 + with: + working-directory: ./src-tauri + - name: Install webkit2gtk (ubuntu only) if: matrix.platform == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y webkit2gtk-4.0 - - name: Rust cache - uses: actions/cache@v2 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - src-tauri/target/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - run: npm install - run: npm run build:web + - run: npm run lint + if: matrix.platform == 'ubuntu-latest' + - run: npm run test - - run: npm run check + - name: Build + uses: tauri-apps/tauri-action@b3f03835ca527e9735b386f1b1302ca70714b1e6 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index f69db52..1a7d056 100644 --- a/README.md +++ b/README.md @@ -29,12 +29,12 @@ Supported file formats: ### Commands - `npm run dev`: Start app in dev mode - `npm run build`: Build +- `npm run lint`: Lint - `npm run format`: Format -- `npm run check`: Check code ### Release new version 1. Update `CHANGELOG.md` -2. Manually bump the version number in `src-tauri/Cargo.toml` -3. Run `npm run check` to make sure `Cargo.lock` is up to date -4. Commit with a tag in the format `v#.#.#` +2. Bump the version number in `src-tauri/Cargo.toml` +3. Run `npm run check` to update `Cargo.lock` +4. Create a git tag in the format `v#.#.#` 5. Add release notes to the generated GitHub release and publish it diff --git a/package.json b/package.json index cfd902b..fe8302a 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,9 @@ "build": "tauri build", "build:web": "vite build", "preview": "vite preview", - "test": "cargo test --manifest-path ./src-tauri/Cargo.toml", - "format": "prettier --write --plugin-search-dir=. src *.js && eslint --fix src *.js", - "check": "cargo check --manifest-path src-tauri/Cargo.toml && eslint src *.js && svelte-check" + "test": "echo 'No tests'", + "lint": "prettier --check --plugin-search-dir=. src *.js && eslint src *.js && svelte-check", + "format": "prettier --write --plugin-search-dir=. src *.js && eslint --fix src *.js" }, "devDependencies": { "@tauri-apps/api": "1.0.0-rc.1",