diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index fa597646..6189d737 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -1,5 +1,8 @@ +# A routine check to see if there are any Rust-specific security vulnerabilities in the repo we should be aware of. + name: audit on: + workflow_dispatch: schedule: - cron: "0 0 * * 1" jobs: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c12e669..20325c8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -69,7 +69,7 @@ jobs: - run: cargo clippy --all-targets --workspace -- -D warnings - # Compile/check/test. + # Run cargo --check on all platforms check: needs: [rustfmt, clippy] runs-on: ${{ matrix.triple.os }} @@ -78,13 +78,12 @@ jobs: fail-fast: false matrix: triple: - # Standard x86-64 stuff, stable + # x86 or x64 - { os: "ubuntu-latest", target: "x86_64-unknown-linux-gnu", cross: false, rust: stable, - toTest: "true", } - { os: "ubuntu-latest", @@ -92,51 +91,42 @@ jobs: cross: true, rust: stable, } - # - { - # os: "ubuntu-latest", - # target: "x86_64-unknown-linux-musl", - # cross: false, - # rust: stable, - # } - # - { - # os: "ubuntu-latest", - # target: "i686-unknown-linux-musl", - # cross: true, - # rust: stable, - # } + - { + os: "ubuntu-latest", + target: "x86_64-unknown-linux-musl", + cross: false, + rust: stable, + } + - { + os: "ubuntu-latest", + target: "i686-unknown-linux-musl", + cross: true, + rust: stable, + } - { os: "macOS-latest", target: "x86_64-apple-darwin", cross: false, rust: stable, - toTest: "true", } - # Big Sur builds are disabled, unfortunately. - # - { - # os: "macOS-11.0", - # target: "x86_64-apple-darwin", - # cross: false, - # rust: stable, - # } - { os: "windows-2019", target: "x86_64-pc-windows-msvc", cross: false, rust: stable, - toTest: "true", } - { os: "windows-2019", target: "i686-pc-windows-msvc", - cross: true, + cross: false, + rust: stable, + } + - { + os: "windows-2019", + target: "x86_64-pc-windows-gnu", + cross: false, rust: stable, } - # - { - # os: "windows-2019", - # target: "x86_64-pc-windows-gnu", - # cross: false, - # rust: stable, - # } # aarch64 - { @@ -208,16 +198,100 @@ jobs: args: --all-targets --verbose --target=${{ matrix.triple.target }} --features "battery" use-cross: ${{ matrix.triple.cross }} + # Check without the battery feature enabled on x86-64 for supported operating systems + check-without-battery: + needs: [rustfmt, clippy] + runs-on: ${{ matrix.triple.os }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + triple: + - { + os: "ubuntu-latest", + target: "x86_64-unknown-linux-gnu", + cross: false, + rust: stable, + } + - { + os: "macOS-latest", + target: "x86_64-apple-darwin", + cross: false, + rust: stable, + } + - { + os: "windows-2019", + target: "x86_64-pc-windows-msvc", + cross: false, + rust: stable, + } + + steps: + - uses: actions/checkout@v2 + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.triple.rust }} + override: true + target: ${{ matrix.triple.target }} + + - uses: Swatinem/rust-cache@v1 + with: + key: ${{ matrix.triple.target }} + - name: Check without battery feature on the main 3 - if: matrix.triple.toTest == 'true' uses: actions-rs/cargo@v1 with: command: check - args: --all-targets --verbose --target=${{ matrix.triple.target }} + args: --all-targets --verbose --target=${{ matrix.triple.target }} --no-default-features use-cross: ${{ matrix.triple.cross }} + # Run tests x86-64 for supported operating systems + test: + needs: [rustfmt, clippy] + runs-on: ${{ matrix.triple.os }} + continue-on-error: true + strategy: + fail-fast: false + matrix: + triple: + - { + os: "ubuntu-latest", + target: "x86_64-unknown-linux-gnu", + cross: false, + rust: stable, + } + - { + os: "macOS-latest", + target: "x86_64-apple-darwin", + cross: false, + rust: stable, + } + - { + os: "windows-2019", + target: "x86_64-pc-windows-msvc", + cross: false, + rust: stable, + } + + steps: + - uses: actions/checkout@v2 + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.triple.rust }} + override: true + target: ${{ matrix.triple.target }} + + - uses: Swatinem/rust-cache@v1 + with: + key: ${{ matrix.triple.target }} + - name: Run tests - if: matrix.triple.toTest == 'true' run: cargo test --no-fail-fast env: CARGO_HUSKY_DONT_INSTALL_HOOKS: true diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 3cf29c6a..2c7ea041 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -15,13 +15,10 @@ on: - "[0-9]+.[0-9]+.[0-9]+" jobs: - create-github-release: - name: create-github-release + initialize-release-job: + name: initialize-release-job runs-on: ubuntu-latest steps: - - name: Create artifacts directory - run: mkdir artifacts - - name: Get the release version from the tag if: env.VERSION == '' run: | @@ -36,31 +33,19 @@ jobs: run: | echo "Version being built against is version ${{ env.VERSION }}"! - - name: Create GitHub release - id: release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - draft: true - tag_name: ${{ env.VERSION }} - release_name: ${{ env.VERSION }} Release - - - name: Save release upload URL to artifact - run: echo "${{ steps.release.outputs.upload_url }}" > artifacts/release-upload-url - - name: Save version number to artifact - run: echo "${{ env.VERSION }}" > artifacts/release-version + run: echo "${{ env.VERSION }}" > release-version - - name: Upload artifacts - uses: actions/upload-artifact@v1 + - name: Upload release-version as artifact + uses: actions/upload-artifact@v2 with: - name: artifacts - path: artifacts + retention-days: 3 + name: release-version + path: release-version build-release: name: build-release - needs: [create-github-release] + needs: [initialize-release-job] runs-on: ${{ matrix.triple.os }} container: ${{ matrix.triple.container }} env: @@ -74,7 +59,6 @@ jobs: os: "ubuntu-18.04", target: "x86_64-unknown-linux-gnu", cross: false, - artifact: true, strip: true, } - { @@ -95,7 +79,6 @@ jobs: os: "ubuntu-18.04", target: "x86_64-unknown-linux-musl", cross: false, - artifact: true, strip: true, } - { @@ -108,21 +91,14 @@ jobs: os: "macOS-latest", target: "x86_64-apple-darwin", cross: false, - artifact: true, strip: true, } - { os: "windows-2019", target: "x86_64-pc-windows-msvc", cross: false, - artifact: true, - } - - { - os: "windows-2019", - target: "i686-pc-windows-msvc", - cross: false, - artifact: true, } + - { os: "windows-2019", target: "i686-pc-windows-msvc", cross: false } - { os: "windows-2019", target: "x86_64-pc-windows-gnu", @@ -134,7 +110,6 @@ jobs: os: "ubuntu-18.04", target: "aarch64-unknown-linux-gnu", cross: true, - artifact: true, } # armv7 @@ -142,7 +117,6 @@ jobs: os: "ubuntu-18.04", target: "armv7-unknown-linux-gnueabihf", cross: true, - artifact: true, } # PowerPC 64 LE @@ -165,25 +139,6 @@ jobs: with: fetch-depth: 1 - - name: Get release download URL - uses: actions/download-artifact@v2 - with: - name: artifacts - path: artifacts - - - name: Set release upload URL and release version - shell: bash - run: | - release_upload_url="$(cat ./artifacts/release-upload-url)" - echo "RELEASE_UPLOAD_URL=$release_upload_url" >> $GITHUB_ENV - release_version="$(cat ./artifacts/release-version)" - echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - - name: Validate release environment variables - run: | - echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}" - echo "Release version: ${{ env.RELEASE_VERSION }}" - - name: Install toolchain uses: actions-rs/toolchain@v1 with: @@ -233,47 +188,29 @@ jobs: tar -czvf bottom_${{ matrix.triple.target }}${{ matrix.triple.suffix }}.tar.gz btm completion echo "ASSET=bottom_${{ matrix.triple.target }}${{ matrix.triple.suffix }}.tar.gz" >> $GITHUB_ENV - - name: Upload main release - uses: actions/upload-release-asset@v1.0.1 - id: upload - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} - asset_path: ${{ env.ASSET }} - asset_name: ${{ env.ASSET }} - asset_content_type: application/octet-stream - - - name: Add download asset to artifact if required - if: matrix.triple.artifact == true - run: cp ${{ env.ASSET }} artifacts/ - - - name: Upload artifacts - uses: actions/upload-artifact@v1 - with: - name: artifacts - path: artifacts + - name: Create release directory for artifact, move file + shell: bash + run: | + mkdir release + mv ${{ env.ASSET }} release/ - name: Compress completion files (Linux x86-64 GNU) if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == '' shell: bash run: | tar -C ./completion -czvf completion.tar.gz . + mv completion.tar.gz release/ - - name: Release completion files (Linux x86-64 GNU) - if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == '' - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Save release as artifact + uses: actions/upload-artifact@v2 with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} - asset_path: completion.tar.gz - asset_name: completion.tar.gz - asset_content_type: application/octet-stream + retention-days: 3 + name: release + path: release build-msi: name: build-msi - needs: [create-github-release] + needs: [initialize-release-job] runs-on: "windows-2019" env: RUST_BACKTRACE: 1 @@ -285,23 +222,20 @@ jobs: - uses: actions/setup-python@v2 - - name: Get release download URL + - name: Get release version uses: actions/download-artifact@v2 with: - name: artifacts - path: artifacts + name: release-version + path: release-version - - name: Set release upload URL and release version + - name: Set release version shell: bash run: | - release_upload_url="$(cat ./artifacts/release-upload-url)" - echo "RELEASE_UPLOAD_URL=$release_upload_url" >> $GITHUB_ENV - release_version="$(cat ./artifacts/release-version)" + release_version="$(cat ./release-version/release-version)" echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - name: Validate release environment variables + - name: Validate release version run: | - echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}" echo "Release version: ${{ env.RELEASE_VERSION }}" - name: Install Net-Framework-Core (Windows x86-64 MSVC) @@ -332,35 +266,29 @@ jobs: cargo wix init cargo wix - - name: Upload msi file - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} - asset_path: bottom_x86_64_installer.msi - asset_name: bottom_x86_64_installer.msi - asset_content_type: application/octet-stream - - name: Build winget run: | python "./deployment/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/windows/winget/winget.yaml.template" "Clement.bottom.yaml" "SHA256" "./bottom_x86_64_installer.msi" $Code = powershell ./deployment/windows/winget/get_product_code.ps1 ./bottom_x86_64_installer.msi python "./deployment/windows/winget/product_code.py" Clement.bottom.yaml $Code - - name: Upload winget file - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create release directory for artifact, move files + shell: bash + run: | + mkdir release + mv bottom_x86_64_installer.msi release/ + mv Clement.bottom.yaml release/ + + - name: Save release as artifact + uses: actions/upload-artifact@v2 with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} - asset_path: Clement.bottom.yaml - asset_name: Clement.bottom.yaml - asset_content_type: application/octet-stream + retention-days: 3 + name: release + path: release build-deb: name: build-deb - needs: [create-github-release] + needs: [initialize-release-job] runs-on: "ubuntu-18.04" env: RUST_BACKTRACE: 1 @@ -370,23 +298,20 @@ jobs: with: fetch-depth: 1 - - name: Get release download URL + - name: Get release version uses: actions/download-artifact@v2 with: - name: artifacts - path: artifacts + name: release-version + path: release-version - - name: Set release upload URL and release version + - name: Set release version shell: bash run: | - release_upload_url="$(cat ./artifacts/release-upload-url)" - echo "RELEASE_UPLOAD_URL=$release_upload_url" >> $GITHUB_ENV - release_version="$(cat ./artifacts/release-version)" + release_version="$(cat ./release-version/release-version)" echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - name: Validate release environment variables + - name: Validate release version run: | - echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}" echo "Release version: ${{ env.RELEASE_VERSION }}" - name: Install toolchain @@ -407,19 +332,22 @@ jobs: cargo deb cp ./target/debian/bottom_*.deb ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb - - name: Upload Debian file (Linux x86-64 GNU) - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} - asset_path: bottom_${{ env.RELEASE_VERSION }}_amd64.deb - asset_name: bottom_${{ env.RELEASE_VERSION }}_amd64.deb - asset_content_type: application/octet-stream + - name: Create release directory for artifact, move file + shell: bash + run: | + mkdir release + mv bottom_${{ env.RELEASE_VERSION }}_amd64.deb release/ - additional-file-generation: + - name: Save release as artifact + uses: actions/upload-artifact@v2 + with: + retention-days: 3 + name: release + path: release + + generate-choco: needs: [build-release] - name: additional-file-generation + name: generate-choco runs-on: ubuntu-latest steps: - name: Checkout repository @@ -429,36 +357,96 @@ jobs: - uses: actions/setup-python@v2 - - name: Get release download URL + - name: Get release version uses: actions/download-artifact@v2 with: - name: artifacts - path: artifacts + name: release-version + path: release-version - - name: Set release upload URL, download URL and version + - name: Set release version shell: bash run: | - release_upload_url="$(cat ./artifacts/release-upload-url)" - echo "RELEASE_UPLOAD_URL=$release_upload_url" >> $GITHUB_ENV - release_version="$(cat ./artifacts/release-version)" + release_version="$(cat ./release-version/release-version)" echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - name: Validate release environment variables + - name: Validate release version run: | - echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}" echo "Release version: ${{ env.RELEASE_VERSION }}" + - name: Get release artifacts + uses: actions/download-artifact@v2 + with: + name: release + path: release + - name: Execute choco packaging script run: | - python "./deployment/windows/choco/choco_packager.py" "./artifacts/bottom_i686-pc-windows-msvc.zip" "./artifacts/bottom_x86_64-pc-windows-msvc.zip" ${{ env.RELEASE_VERSION }} "./deployment/windows/choco/bottom.nuspec.template" "./deployment/windows/choco/chocolateyinstall.ps1.template" "bottom.nuspec" "tools/chocolateyinstall.ps1" "tools/" + python "./deployment/windows/choco/choco_packager.py" "./release/bottom_i686-pc-windows-msvc.zip" "./release/bottom_x86_64-pc-windows-msvc.zip" ${{ env.RELEASE_VERSION }} "./deployment/windows/choco/bottom.nuspec.template" "./deployment/windows/choco/chocolatey_install.ps1.template" "bottom.nuspec" "tools/chocolatey_install.ps1" "tools/" zip -r choco.zip "bottom.nuspec" "tools" - - name: Upload choco.zip to release - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Move release file into release directory + shell: bash + run: | + mv choco.zip release/ + + - name: Save release as artifact + uses: actions/upload-artifact@v2 with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} - asset_path: choco.zip - asset_name: choco.zip - asset_content_type: application/octet-stream + retention-days: 3 + name: release + path: release + + upload-release: + name: upload-release + runs-on: ubuntu-latest + needs: [generate-choco, build-deb, build-msi] + steps: + - name: Get release version + uses: actions/download-artifact@v2 + with: + name: release-version + path: release-version + + - name: Set release version + shell: bash + run: | + release_version="$(cat ./release-version/release-version)" + echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV + + - name: Validate release version + run: | + echo "Release version: ${{ env.RELEASE_VERSION }}" + + - name: Get release artifacts + uses: actions/download-artifact@v2 + with: + name: release + path: release + + - name: Print out all release files + run: | + echo "Generated $(ls ./release | wc -l) files:" + ls ./release + + - name: Upload all saved release files + uses: softprops/action-gh-release@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + prerelease: false + tag_name: ${{ env.RELEASE_VERSION }} + draft: true + fail_on_unmatched_files: true + name: ${{ env.RELEASE_VERSION }} Release + body: | + + --- + + ## Features + + ## Changes + + ## Bug Fixes + + ## Internal Changes + files: | + ./release/* diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index eeaaf405..b8fd4980 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -5,13 +5,13 @@ on: branches: - master paths: - - 'docs/**' - - '.github/workflows/docs.yml' + - "docs/**" + - ".github/workflows/docs.yml" env: # Assign commit authorship to official Github Actions bot when pushing to the `gh-pages` branch: - GIT_USER: 'github-actions[bot]' - GIT_EMAIL: '41898282+github-actions[bot]@users.noreply.github.com' + GIT_USER: "github-actions[bot]" + GIT_EMAIL: "41898282+github-actions[bot]@users.noreply.github.com" jobs: build-documentation: @@ -26,11 +26,8 @@ jobs: with: python-version: 3.x - - run: pip install mkdocs-material==7.2.6 - - - run: pip install mdx_truly_sane_lists==1.2 - - - run: pip install mike==1.1.0 + - name: Install Python dependencies + run: pip install -r docs/requirements.txt - name: Configure git user and email run: | diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1a012253..c1f7f8da 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,13 +14,10 @@ on: required: false jobs: - create-github-release: - name: create-github-release + initialize-job: + name: initialize-job runs-on: ubuntu-latest steps: - - name: Create artifacts directory - run: mkdir artifacts - - name: Check if mock run: | echo "${{ github.event.inputs.isMock }}"; @@ -32,45 +29,19 @@ jobs: echo "This is NOT a mock run. Watch for the generated files!" fi - - name: Delete tag and release - uses: dev-drprasad/delete-tag-and-release@v0.1.3 - if: github.event.inputs.isMock != 'mock' - with: - delete_release: true - tag_name: nightly - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Sleep for a few seconds to prevent timing issues between the deletion and creation of the release - run: sleep 10 - - - name: Create nightly GitHub release - id: release - uses: actions/create-release@v1 - if: github.event.inputs.isMock != 'mock' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - draft: false - tag_name: nightly - release_name: nightly - prerelease: true - - - name: Save release upload URL to artifact - run: echo "${{ steps.release.outputs.upload_url }}" > artifacts/release-upload-url - - name: Save version number to artifact - run: echo "nightly" > artifacts/release-version + run: echo "nightly" > release-version - - name: Upload artifacts - uses: actions/upload-artifact@v1 + - name: Upload release-version as artifact + uses: actions/upload-artifact@v2 with: - name: artifacts - path: artifacts + retention-days: 1 + name: release-version + path: release-version build-release: name: build-release - needs: [create-github-release] + needs: [initialize-job] runs-on: ${{ matrix.triple.os }} container: ${{ matrix.triple.container }} env: @@ -164,25 +135,6 @@ jobs: with: fetch-depth: 1 - - name: Get release download URL - uses: actions/download-artifact@v2 - with: - name: artifacts - path: artifacts - - - name: Set release upload URL and release version - shell: bash - run: | - release_upload_url="$(cat ./artifacts/release-upload-url)" - echo "RELEASE_UPLOAD_URL=$release_upload_url" >> $GITHUB_ENV - release_version="$(cat ./artifacts/release-version)" - echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - - name: Validate release environment variables - run: | - echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}" - echo "Release version: ${{ env.RELEASE_VERSION }}" - - name: Install toolchain uses: actions-rs/toolchain@v1 with: @@ -232,38 +184,29 @@ jobs: tar -czvf bottom_${{ matrix.triple.target }}${{ matrix.triple.suffix }}.tar.gz btm completion echo "ASSET=bottom_${{ matrix.triple.target }}${{ matrix.triple.suffix }}.tar.gz" >> $GITHUB_ENV - - name: Upload main release - if: github.event.inputs.isMock != 'mock' - uses: actions/upload-release-asset@v1.0.1 - id: upload - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} - asset_path: ${{ env.ASSET }} - asset_name: ${{ env.ASSET }} - asset_content_type: application/octet-stream + - name: Create release directory for artifact, move file + shell: bash + run: | + mkdir release + mv ${{ env.ASSET }} release/ - name: Compress completion files (Linux x86-64 GNU) if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == '' shell: bash run: | tar -C ./completion -czvf completion.tar.gz . + mv completion.tar.gz release/ - - name: Release completion files (Linux x86-64 GNU) - if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == '' && github.event.inputs.isMock != 'mock' - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Save release files as artifacts + uses: actions/upload-artifact@v2 with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} - asset_path: completion.tar.gz - asset_name: completion.tar.gz - asset_content_type: application/octet-stream + retention-days: 1 + name: release + path: release build-msi: name: build-msi - needs: [create-github-release] + needs: [initialize-job] runs-on: "windows-2019" env: RUST_BACKTRACE: 1 @@ -273,23 +216,20 @@ jobs: with: fetch-depth: 1 - - name: Get release download URL + - name: Get release version uses: actions/download-artifact@v2 with: - name: artifacts - path: artifacts + name: release-version + path: release-version - - name: Set release upload URL and release version + - name: Set release version shell: bash run: | - release_upload_url="$(cat ./artifacts/release-upload-url)" - echo "RELEASE_UPLOAD_URL=$release_upload_url" >> $GITHUB_ENV - release_version="$(cat ./artifacts/release-version)" + release_version="$(cat ./release-version/release-version)" echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - name: Validate release environment variables + - name: Validate release version run: | - echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}" echo "Release version: ${{ env.RELEASE_VERSION }}" - name: Install Net-Framework-Core @@ -320,20 +260,22 @@ jobs: cargo wix init cargo wix - - name: Upload msi file - if: github.event.inputs.isMock != 'mock' - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create release directory for artifact, move file + shell: bash + run: | + mkdir release + mv bottom_x86_64_installer.msi release/ + + - name: Save msi file as artifacts + uses: actions/upload-artifact@v2 with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} - asset_path: bottom_x86_64_installer.msi - asset_name: bottom_x86_64_installer.msi - asset_content_type: application/octet-stream + retention-days: 1 + name: release + path: release build-deb: name: build-deb - needs: [create-github-release] + needs: [initialize-job] runs-on: "ubuntu-18.04" env: RUST_BACKTRACE: 1 @@ -343,23 +285,20 @@ jobs: with: fetch-depth: 1 - - name: Get release download URL + - name: Get release version uses: actions/download-artifact@v2 with: - name: artifacts - path: artifacts + name: release-version + path: release-version - - name: Set release upload URL and release version + - name: Set release version shell: bash run: | - release_upload_url="$(cat ./artifacts/release-upload-url)" - echo "RELEASE_UPLOAD_URL=$release_upload_url" >> $GITHUB_ENV - release_version="$(cat ./artifacts/release-version)" + release_version="$(cat ./release-version/release-version)" echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - name: Validate release environment variables + - name: Validate release version run: | - echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}" echo "Release version: ${{ env.RELEASE_VERSION }}" - name: Install toolchain @@ -380,13 +319,56 @@ jobs: cargo deb cp ./target/debian/bottom_*.deb ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb - - name: Upload Debian file if not mock + - name: Create release directory for artifact, move file + shell: bash + run: | + mkdir release + mv bottom_${{ env.RELEASE_VERSION }}_amd64.deb release/ + + - name: Save Debian file as artifacts + uses: actions/upload-artifact@v2 + with: + retention-days: 1 + name: release + path: release + + upload-release: + name: upload-release + runs-on: ubuntu-latest + needs: [build-release, build-deb, build-msi] + steps: + - name: Get release artifacts + uses: actions/download-artifact@v2 + with: + name: release + path: release + + - name: Print out all release files + run: | + echo "Generated $(ls ./release | wc -l) files:" + ls ./release + + - name: Delete tag and release + uses: dev-drprasad/delete-tag-and-release@v0.1.3 if: github.event.inputs.isMock != 'mock' - uses: actions/upload-release-asset@v1.0.1 + with: + delete_release: true + tag_name: nightly env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Sleep for a few seconds to prevent timing issues between the deletion and creation of the release + run: sleep 10 + if: github.event.inputs.isMock != 'mock' + + - name: Upload all saved release files if not mock + uses: softprops/action-gh-release@v1 + if: github.event.inputs.isMock != 'mock' with: - upload_url: ${{ env.RELEASE_UPLOAD_URL }} - asset_path: bottom_${{ env.RELEASE_VERSION }}_amd64.deb - asset_name: bottom_${{ env.RELEASE_VERSION }}_amd64.deb - asset_content_type: application/octet-stream + token: ${{ secrets.GITHUB_TOKEN }} + prerelease: true + tag_name: "nightly" + draft: false + fail_on_unmatched_files: true + files: | + ./release/* diff --git a/.github/workflows/post-release.yml b/.github/workflows/post-release.yml index 1cd7e728..5eed7cc4 100644 --- a/.github/workflows/post-release.yml +++ b/.github/workflows/post-release.yml @@ -1,4 +1,4 @@ -# Actions to run after releasing a version. +# Actions to run after releasing a version, like generating documentation via mkdocs or notifying packaging repos. name: post-release on: @@ -27,15 +27,9 @@ jobs: run: | echo $RELEASE_VERSION - - name: Make sure you're not on master... + - name: Make sure you're not on master/main/nightly... run: | - if [[ $RELEASE_VERSION == "master" ]]; then - exit 1 - fi - - - name: Make sure you're not on nightly... - run: | - if [[ $RELEASE_VERSION == "nightly" ]]; then + if [[ $RELEASE_VERSION == "master" || $RELEASE_VERSION == "main" || $RELEASE_VERSION == "nightly" ]]; then exit 1 fi @@ -43,11 +37,8 @@ jobs: with: python-version: 3.x - - run: pip install mkdocs-material==7.2.6 - - - run: pip install mdx_truly_sane_lists==1.2 - - - run: pip install mike==1.1.0 + - name: Install Python dependencies + run: pip install -r docs/requirements.txt - name: Configure git user and email run: | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4c679913..8a470ff2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -15,16 +15,21 @@ Please use the [feature request template](https://github.com/ClementTsang/bottom ## Pull requests -The expected workflow for a pull request is: +If you want to directly contribute documentation changes or code, follow this! The expected workflow for a pull request is: 1. Fork the project. -2. Make your changes. -3. Make any documentation changes if necessary - if you add a new feature, it'll probably need documentation changes. See [here](./documentation.md) for tips on documentation. -4. Commit and create a pull request to merge into the `master` branch. **Please follow the pull request template**. -5. Wait for the tests to pass. These consist of clippy lints, rustfmt checks, and basic tests. **If you are a first time contributor, you may need to skip this step for now, as GitHub Actions requires approval to run.** -6. Ask a maintainer to review your pull request. If changes are suggested or any comments are made, they should probably be addressed. Once it looks good, it'll be merged! +2. Make your changes locally. +3. Commit and create a pull request to merge into the `master` branch. **Please follow the pull request template**. +4. Wait for the tests to pass. These consist of clippy lints, rustfmt checks, and basic tests. **If you are a first time contributor, skip to the next step for now, as GitHub Actions requires approval to run.** +5. Ask a maintainer to review your pull request. If changes are suggested or any comments are made, they should probably be addressed. Once it looks good, it'll be merged! -## Further reading +For more details, see [here](https://clementtsang.github.io/bottom/nightly/contribution/issues-and-pull-requests/). -- For details on contributing to documentation, see [here](https://clementtsang.github.io/bottom/nightly/contribution/documentation/). -- For details on packaging and distribution, see [here](https://clementtsang.github.io/bottom/nightly/contribution/packaging-and-distribution/). +### Documentation + +For contributing to documentation, see [here](https://clementtsang.github.io/bottom/nightly/contribution/documentation/). + +### Packaging + +If you want to become a package maintainer, look [here](https://clementtsang.github.io/bottom/nightly/contribution/packaging-and-distribution/) +for instructions on how to build bottom and add installation instructions to the README. diff --git a/Cargo.lock b/Cargo.lock index 5973baf8..7d6f91c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,7 +49,7 @@ checksum = "c98233c6673d8601ab23e77eb38f999c51100d46c5703b17288c57fddf3a1ffe" dependencies = [ "bstr", "doc-comment", - "predicates 2.0.2", + "predicates 2.0.3", "predicates-core", "predicates-tree", "wait-timeout", @@ -210,9 +210,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "blocking" @@ -238,7 +238,6 @@ dependencies = [ "battery", "cargo-husky", "cfg-if", - "chrono", "clap", "crossterm", "ctrlc", @@ -264,6 +263,7 @@ dependencies = [ "sysinfo", "textwrap 0.14.2", "thiserror", + "time", "toml", "tui", "unicode-segmentation", @@ -273,9 +273,9 @@ dependencies = [ [[package]] name = "bstr" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279" +checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223" dependencies = [ "lazy_static", "memchr", @@ -308,9 +308,9 @@ checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" [[package]] name = "cc" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" [[package]] name = "cfg-if" @@ -318,19 +318,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" -dependencies = [ - "libc", - "num-integer", - "num-traits", - "time", - "winapi", -] - [[package]] name = "clap" version = "2.33.3" @@ -367,11 +354,11 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" dependencies = [ - "core-foundation-sys 0.8.2", + "core-foundation-sys 0.8.3", "libc", ] @@ -383,9 +370,9 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "core-foundation-sys" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "crc32fast" @@ -467,11 +454,11 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.2.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377c9b002a72a0b2c1a18c62e2f3864bdfea4a015e3683a96e24aa45dd6c02d1" +checksum = "a19c6cedffdc8c03a3346d723eb20bd85a13362bb96dc2ac000842c6381ec7bf" dependencies = [ - "nix 0.22.1", + "nix 0.23.0", "winapi", ] @@ -757,7 +744,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d767e6e47cf88abe7c9a5ebb4df82f180d30d9c0ba0269b6d166482461765834" dependencies = [ "cfg-if", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "futures-core", "futures-util", "lazy_static", @@ -796,7 +783,7 @@ checksum = "75603ff3868851c04954ee86bf610a6bd45be2732a0e81c35fd72b2b90fa4718" dependencies = [ "bitflags", "cfg-if", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "heim-common", "heim-runtime", "libc", @@ -891,9 +878,9 @@ checksum = "990980c3d268c9b99df35e813eca2b8d1ee08606f6d2bb325edbd0b0c68f9ffe" [[package]] name = "instant" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" +checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd" dependencies = [ "cfg-if", ] @@ -907,6 +894,12 @@ dependencies = [ "either", ] +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + [[package]] name = "lazy_static" version = "1.4.0" @@ -921,9 +914,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.102" +version = "0.2.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103" +checksum = "7b2f96d100e1cf1929e7719b7edb3b90ab5298072638fccd77be9ce942ecdfce" [[package]] name = "lock_api" @@ -985,9 +978,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2bdb6314ec10835cd3293dd268473a835c02b7b352e788be788b3c6ca6bb16" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -1019,9 +1012,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.22.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7555d6c7164cc913be1ce7f95cbecdabda61eb2ccd89008524af306fb7f5031" +checksum = "f305c2c2e4c39a82f7bf0bf65fb557f9070ce06781d4f2454295cc34b1c43188" dependencies = [ "bitflags", "cc", @@ -1171,9 +1164,9 @@ dependencies = [ [[package]] name = "predicates" -version = "2.0.2" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c143348f141cc87aab5b950021bac6145d0e5ae754b0591de23244cee42c9308" +checksum = "5c6ce811d0b2e103743eec01db1c50612221f173084ce2f7941053e94b6bb474" dependencies = [ "difflib", "itertools", @@ -1188,12 +1181,12 @@ checksum = "57e35a3326b75e49aa85f5dc6ec15b41108cf5aee58eabb1f274dd18b73c2451" [[package]] name = "predicates-tree" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7dd0fd014130206c9352efbdc92be592751b2b9274dff685348341082c6ea3d" +checksum = "338c7be2905b732ae3984a2f40032b5e94fd8f52505b186c7d4d68d193445df7" dependencies = [ "predicates-core", - "treeline", + "termtree", ] [[package]] @@ -1210,22 +1203,21 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70" dependencies = [ "unicode-xid", ] [[package]] name = "procfs" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95e344cafeaeefe487300c361654bcfc85db3ac53619eeccced29f5ea18c4c70" +checksum = "3f2e7eea7c1d7beccbd5acc1e37ac844afccf176525674aad26ece3de1fc7733" dependencies = [ "bitflags", "byteorder", - "chrono", "flate2", "hex", "lazy_static", @@ -1234,9 +1226,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ "proc-macro2", ] @@ -1372,15 +1364,15 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" [[package]] name = "smawk" @@ -1424,9 +1416,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "syn" -version = "1.0.76" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f107db402c2c2055242dbf4d2af0e69197202e9faacbef9571bbe47f5a1b84" +checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" dependencies = [ "proc-macro2", "quote", @@ -1440,7 +1432,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d404aefa651a24a7f2a1190fec9fb6380ba84ac511a6fefad79eb0e63d39a97d" dependencies = [ "cfg-if", - "core-foundation-sys 0.8.2", + "core-foundation-sys 0.8.3", "doc-comment", "libc", "ntapi", @@ -1449,6 +1441,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "termtree" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78fbf2dd23e79c28ccfa2472d3e6b3b189866ffef1aeb91f17c2d968b6586378" + [[package]] name = "textwrap" version = "0.11.0" @@ -1471,18 +1469,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -1491,15 +1489,21 @@ dependencies = [ [[package]] name = "time" -version = "0.1.44" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "cde1cf55178e0293453ba2cca0d5f8392a922e52aa958aee9c28ed02becc6d03" dependencies = [ + "itoa", "libc", - "wasi", - "winapi", + "time-macros", ] +[[package]] +name = "time-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25eb0ca3468fc0acc11828786797f6ef9aa1555e4a211a60d64cc8e4d1be47d6" + [[package]] name = "toml" version = "0.5.8" @@ -1509,12 +1513,6 @@ dependencies = [ "serde", ] -[[package]] -name = "treeline" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" - [[package]] name = "tui" version = "0.16.0" @@ -1595,9 +1593,9 @@ checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wepoll-ffi" diff --git a/Cargo.toml b/Cargo.toml index d44d54f6..20a936aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,6 @@ default = ["fern", "log", "battery"] [dependencies] anyhow = "1.0.40" backtrace = "0.3.59" -chrono = "0.4.19" crossterm = "0.20.0" ctrlc = { version = "3.1.9", features = ["termination"] } clap = "2.33" @@ -57,6 +56,7 @@ serde = { version = "1.0.125", features = ["derive"] } sysinfo = "0.18.2" thiserror = "1.0.24" textwrap = "0.14.2" +time = { version = "0.3.3", features = ["formatting", "local-offset", "macros"] } toml = "0.5.8" tui = { version = "0.16.0", features = ["crossterm"], default-features = false } unicode-segmentation = "1.8.0" @@ -72,7 +72,7 @@ libc = "0.2.86" [target.'cfg(target_os = "linux")'.dependencies] heim = { version = "0.1.0-rc.1", features = ["cpu", "disk", "net", "sensors"] } -procfs = "0.10.1" +procfs = { version = "0.11.0", default-features = false } smol = "1.2.5" [target.'cfg(target_os = "macos")'.dependencies] diff --git a/README.md b/README.md index 4b89f07a..feed9943 100644 --- a/README.md +++ b/README.md @@ -244,12 +244,13 @@ More details on configuration can be found [in the documentation](https://clemen ## Contribution -Whether it's reporting problems, documentation, or code, contribution is always welcome! Please read -[CONTRIBUTING.md](./CONTRIBUTING.md) for details on how to contribute to bottom. +Whether it's reporting bugs, suggesting features, maintaining packages, or submitting a PR, +contribution is always welcome! Please read [CONTRIBUTING.md](./CONTRIBUTING.md) for details on how to +contribute to bottom. ### Contributors -Thanks to all contributors ([emoji key](https://allcontributors.org/docs/en/emoji-key)): +Thanks to all contributors: diff --git a/deployment/windows/choco/choco_packager.py b/deployment/windows/choco/choco_packager.py index 1e5c5684..da8e2960 100644 --- a/deployment/windows/choco/choco_packager.py +++ b/deployment/windows/choco/choco_packager.py @@ -49,7 +49,7 @@ with open(deployment_file_path_32, "rb") as deployment_file_32, open( with open(ps1_template, "r") as template_file: template = Template(template_file.read()) substitute = template.safe_substitute(version=version, hash_32=hash_32, hash_64=hash_64) - print("\n================== Generated chocolateyinstall file ==================\n") + print("\n================== Generated chocolatey-install file ==================\n") print(substitute) print("\n============================================================\n") diff --git a/deployment/windows/choco/chocolateyinstall.ps1.template b/deployment/windows/choco/chocolatey_install.ps1.template similarity index 100% rename from deployment/windows/choco/chocolateyinstall.ps1.template rename to deployment/windows/choco/chocolatey_install.ps1.template diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..b29234b0 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +mkdocs-material == 7.3.2 +mdx_truly_sane_lists == 1.2 +mike == 1.1.2 \ No newline at end of file diff --git a/rustfmt.toml b/rustfmt.toml index 61aee1cc..03574d14 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,4 +1,3 @@ -edition = "2018" reorder_imports = true reorder_modules = true merge_derives = true diff --git a/src/app/data_harvester/processes/linux.rs b/src/app/data_harvester/processes/linux.rs index 2e9384f5..5d11ca7b 100644 --- a/src/app/data_harvester/processes/linux.rs +++ b/src/app/data_harvester/processes/linux.rs @@ -163,7 +163,7 @@ fn read_proc( use_current_cpu_total, ); let parent_pid = Some(stat.ppid); - let mem_usage_bytes = u64::try_from(stat.rss_bytes()).unwrap_or(0); + let mem_usage_bytes = u64::try_from(stat.rss_bytes()?).unwrap_or(0); let mem_usage_kb = mem_usage_bytes / 1024; let mem_usage_percent = mem_usage_kb as f64 / mem_total_kb as f64 * 100.0; diff --git a/src/data_conversion.rs b/src/data_conversion.rs index 4ca3ae9c..a61567c5 100644 --- a/src/data_conversion.rs +++ b/src/data_conversion.rs @@ -1052,36 +1052,36 @@ pub fn convert_battery_harvest(current_data: &DataCollection) -> Vec Result<(), fern::InitError> { fern::Dispatch::new() .format(|out, message, record| { + let offset = time::OffsetDateTime::now_utc(); + out.finish(format_args!( "{}[{}][{}] {}", - chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S:%f]"), + offset + .format(&time::macros::format_description!( + // The weird "[[[" is because we need to escape a bracket ("[[") to show one "[". + // See https://time-rs.github.io/book/api/format-description.html + "[[[year]-[month]-[day]][[[hour]:[minute]:[second][subsecond digits:9]]" + )) + .unwrap(), record.target(), record.level(), message