diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 0000000..e976160 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,19 @@ +self-hosted-runner: + # Labels of self-hosted runner in array of strings. + labels: [] + +# Configuration variables in array of strings defined in your repository or +# organization. `null` means disabling configuration variables check. +# Empty array means no configuration variable is allowed. +config-variables: + +# Configuration for file paths. The keys are glob patterns to match to file +# paths relative to the repository root. The values are the configurations for +# the file paths. Note that the path separator is always '/'. +# The following configurations are available. +# +# "ignore" is an array of regular expression patterns. Matched error messages +# are ignored. This is similar to the "-ignore" command line option. +paths: +# .github/workflows/**/*.yml: +# ignore: [] diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 971eb18..953d35f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,17 +1,17 @@ name: Lint on: - pull_request: - push: - branches: [master] + pull_request: + push: + branches: [master] jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - components: rustfmt,clippy - - uses: actions/setup-python@v5 - - uses: pre-commit/action@v3.0.1 + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt,clippy + - uses: actions/setup-python@v5 + - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 520ae53..3033efa 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,80 +1,81 @@ name: Release permissions: - contents: write + contents: write on: - push: - tags: ['*'] + push: + tags: ['*'] jobs: - create-release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: taiki-e/create-gh-release-action@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} + create-release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: taiki-e/create-gh-release-action@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} - upload-assets: - needs: create-release - strategy: - fail-fast: false - matrix: - include: - - target: aarch64-apple-darwin - os: macos-latest - - target: aarch64-unknown-linux-gnu - os: ubuntu-latest - - target: arm-unknown-linux-gnueabihf - os: ubuntu-latest - - target: armv7-unknown-linux-gnueabihf - os: ubuntu-latest - - target: x86_64-apple-darwin - os: macos-latest - - target: x86_64-pc-windows-msvc - os: windows-latest - - target: aarch64-pc-windows-msvc - os: windows-latest - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v4 + upload-assets: + needs: create-release + strategy: + fail-fast: false + matrix: + include: + - target: aarch64-apple-darwin + os: macos-latest + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + - target: arm-unknown-linux-gnueabihf + os: ubuntu-latest + - target: armv7-unknown-linux-gnueabihf + os: ubuntu-latest + - target: x86_64-apple-darwin + os: macos-latest + - target: x86_64-pc-windows-msvc + os: windows-latest + - target: aarch64-pc-windows-msvc + os: windows-latest + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 # Some windows magic # https://github.com/nymtech/nym-vpn-client/pull/54/files#diff-7a42dc8739297053550b8882b7bf3fcc770725f51365f7b273ed5a7d9d91c329R151 # https://github.com/sfackler/rust-openssl/issues/2149 - - name: Enable git long-paths - if: contains(matrix.os, 'windows') - run: git config --system core.longpaths true - - name: Setup Perl - uses: shogo82148/actions-setup-perl@v1 - if: contains(matrix.os, 'windows') - with: - perl-version: '5.38' - distribution: strawberry - - id: windows-configure-perl - if: contains(matrix.os, 'windows') - run: | - echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 - echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + - name: Enable git long-paths + if: contains(matrix.os, 'windows') + run: git config --system core.longpaths true + - name: Setup Perl + uses: shogo82148/actions-setup-perl@v1 + if: contains(matrix.os, 'windows') + with: + perl-version: '5.38' + distribution: strawberry + - id: windows-configure-perl + if: contains(matrix.os, 'windows') + run: | + # shellcheck disable=SC1073,SC1009,SC1072 + echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 - - uses: taiki-e/upload-rust-binary-action@v1 - with: + - uses: taiki-e/upload-rust-binary-action@v1 + with: # (required) Comma-separated list of binary names (non-extension portion of filename) to build and upload. # Note that glob pattern is not supported yet. - bin: toggl-tracker - checksum: sha256 - target: ${{ matrix.target }} - token: ${{ secrets.GITHUB_TOKEN }} + bin: toggl-tracker + checksum: sha256 + target: ${{ matrix.target }} + token: ${{ secrets.GITHUB_TOKEN }} - complete-release: - needs: upload-assets - runs-on: ubuntu-latest - steps: - - uses: softprops/action-gh-release@v2 - with: - draft: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + complete-release: + needs: upload-assets + runs-on: ubuntu-latest + steps: + - uses: softprops/action-gh-release@v2 + with: + draft: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bfc0a45..3039ba6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 hooks: - id: check-added-large-files - id: trailing-whitespace @@ -11,11 +11,31 @@ repos: - id: check-symlinks - id: mixed-line-ending args: [--fix=lf] - - id: check-toml - - id: check-yaml - - repo: https://github.com/doublify/pre-commit-rust + - id: check-toml + - id: check-yaml + +- repo: https://github.com/doublify/pre-commit-rust rev: v1.0 hooks: - - id: fmt - - id: cargo-check - - id: clippy + - id: fmt + - id: cargo-check + - id: clippy + +- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.14.0 + hooks: + - id: pretty-format-yaml + args: [--autofix, --indent, '4'] + - id: pretty-format-toml + args: [--autofix, --indent, '4', --trailing-comma] + exclude: ^Cargo.lock$ + +- repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.29.4 + hooks: + - id: check-github-workflows + +- repo: https://github.com/rhysd/actionlint + rev: v1.7.4 + hooks: + - id: actionlint diff --git a/Cargo.toml b/Cargo.toml index 5e33aae..c03bf93 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,28 +1,28 @@ -[package] -name = "toggl-tracker" -version = "0.1.0" -edition = "2021" - [dependencies] async-std = "1.13.0" base64 = "0.22.1" -chrono = { version = "0.4.38", features = ["serde", "unstable-locales"] } +chrono = {version = "0.4.38", features = ["serde", "unstable-locales"]} directories-next = "2.0.0" env_logger = "0.11.5" -iced = { version = "0.13.1", features = ["async-std", "debug", "advanced", "image"] } -iced_aw = { version = "0.11.0", features = ["badge", "menu"], default-features = false } +iced = {version = "0.13.1", features = ["async-std", "debug", "advanced", "image"]} +iced_aw = {version = "0.11.0", features = ["badge", "menu"], default-features = false} itertools = "0.13.0" lazy_static = "1.5.0" -log = { version = "0.4.22", features = ["max_level_trace", "release_max_level_info"] } -openssl = { version = "0.10.66", features = ["vendored"] } -serde = { version = "1.0.210", features = ["derive"] } +log = {version = "0.4.22", features = ["max_level_trace", "release_max_level_info"]} +openssl = {version = "0.10.66", features = ["vendored"]} +serde = {version = "1.0.210", features = ["derive"]} serde_json = "1.0.128" -surf = { version = "2.3.2" } +surf = {version = "2.3.2"} sys-locale = "0.3.1" [dev-dependencies] -async-std = { version = "1.13.0", features = ["attributes"] } +async-std = {version = "1.13.0", features = ["attributes"]} + +[package] +edition = "2021" +name = "toggl-tracker" +version = "0.1.0" [profile.release] -strip = true lto = true +strip = true diff --git a/README.md b/README.md index 5998183..372b963 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Toggl Track client +[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/) + ## Disclaimer This project is built solely by me with no affiliation with Toggl OÜ whatsoever.