summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClement Tsang <34804052+ClementTsang@users.noreply.github.com>2021-10-31 01:48:48 -0400
committerGitHub <noreply@github.com>2021-10-31 01:48:48 -0400
commit5833cb8ad1f30d42efd9dc7f5f27bed35882bc95 (patch)
tree438939c6d1d66252d9f00d713ee3fc348593a41f
parentf02daa0a2b2b38934bcb2189373afec85862048d (diff)
parent77ada576c548614cca35feae0af950fd423be78c (diff)
Merge branch 'master' into state_refactor
-rw-r--r--.github/workflows/audit.yml3
-rw-r--r--.github/workflows/ci.yml142
-rw-r--r--.github/workflows/deployment.yml288
-rw-r--r--.github/workflows/docs.yml15
-rw-r--r--.github/workflows/nightly.yml206
-rw-r--r--.github/workflows/post-release.yml19
-rw-r--r--CONTRIBUTING.md23
-rw-r--r--Cargo.lock146
-rw-r--r--Cargo.toml4
-rw-r--r--README.md7
-rw-r--r--deployment/windows/choco/choco_packager.py2
-rw-r--r--deployment/windows/choco/chocolatey_install.ps1.template (renamed from deployment/windows/choco/chocolateyinstall.ps1.template)0
-rw-r--r--docs/requirements.txt3
-rw-r--r--rustfmt.toml1
-rw-r--r--src/app/data_harvester/processes/linux.rs2
-rw-r--r--src/data_conversion.rs24
-rw-r--r--src/utils/logging.rs10
17 files changed, 472 insertions, 423 deletions
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 }}
+ - name: Create release directory for artifact, move file
+ shell: bash
+ run: |
+ mkdir release
+ mv bottom_${{ env.RELEASE_VERSION }}_amd64.deb release/
+
+ - name: Save release as artifact
+ uses: actions/upload-artifact@v2
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
+ retention-days: 3
+ name: release
+ path: release
- additional-file-generation:
+ 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:
+ 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:
- upload_url: ${{ env.RELEASE_UPLOAD_URL }}
- asset_path: choco.zip
- asset_name: choco.zip
- asset_content_type: application/octet-stream
+ token: ${{ secrets.GITHUB_TOKEN }}
+ prerelease: false
+ tag_name: ${{ env.RELEASE_VERSION }}
+ draft: true
+ fail_on_unmatched_files: true
+ name: ${{ env.RELEASE_VERSION }} Release
+ body: |
+ <!-- Write summary here -->
+ ---
+
+ ## 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]