diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 5e500bf9..a57b22f1 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -1,4 +1,4 @@ -name: cargo-audit check +name: audit on: schedule: - cron: "0 5 * * *" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e35ab07..1d8f6d41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,5 @@ +# Main CI pipeline to validate PRs. +# # CI pipeline based on: # - https://github.com/heim-rs/heim/blob/master/.github/workflows/ci.yml # - https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/ci.yml diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index da03ef13..b584d390 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -1,3 +1,5 @@ +# How we deploy a release. Covers binary builds. Also manages packaging for AUR, winget, choco, and homebrew. +# # Based on: # - https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml @@ -5,6 +7,10 @@ name: deployment on: workflow_dispatch: + inputs: + tag: + description: "Which tag to test against." + required: true push: tags: - "[0-9]+.[0-9]+.[0-9]+" @@ -17,21 +23,19 @@ jobs: - name: Create artifacts directory run: mkdir artifacts - # TODO: Make this easier to test with. - - name: Get the release version from the tag if: env.VERSION == '' run: | - echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + if [[ -n "${{ github.event.inputs.tag }}" ]]; then + echo "Manual run against a tag; overriding actual tag in the environment..." + echo "VERSION=${{ github.event.inputs.tag }}" >> $GITHUB_ENV + else + echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + fi - # - name: Hard-coded release version for testing - # if: env.VERSION == '' - # run: | - # echo "VERSION=0.5.1" >> $GITHUB_ENV - - - name: Validate the release version from the tag + - name: Validate version environment variable run: | - echo "Version is: ${{ env.VERSION }}" + echo "Version being built against is version ${{ env.VERSION }}"! - name: Create GitHub release id: release @@ -142,11 +146,10 @@ jobs: release_version="$(cat ./artifacts/release-version)" echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - name: Check release upload URL and release version - shell: bash + - name: Validate release environment variables run: | - echo "release upload url: $RELEASE_UPLOAD_URL" - echo "release version: $RELEASE_VERSION" + echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}" + echo "Release version: ${{ env.RELEASE_VERSION }}" - name: Install Net-Framework-Core (Windows x86-64 MSVC) if: matrix.triple.target == 'x86_64-pc-windows-msvc' @@ -332,22 +335,21 @@ jobs: release_version="$(cat ./artifacts/release-version)" echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV - - name: Check release upload URL and release version - shell: bash + - name: Validate release environment variables run: | - echo "release upload url: $RELEASE_UPLOAD_URL" - echo "release version: $RELEASE_VERSION" + echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}" + echo "Release version: ${{ env.RELEASE_VERSION }}" - name: Download packages run: | - curl -LO "https://github.com/ClementTsang/bottom/releases/download/$RELEASE_VERSION/bottom_x86_64-unknown-linux-gnu.tar.gz"; - curl -LO "https://github.com/ClementTsang/bottom/releases/download/$RELEASE_VERSION/bottom_x86_64-apple-darwin.tar.gz"; - curl -LO "https://github.com/ClementTsang/bottom/releases/download/$RELEASE_VERSION/bottom_i686-pc-windows-msvc.zip"; - curl -LO "https://github.com/ClementTsang/bottom/releases/download/$RELEASE_VERSION/bottom_x86_64-pc-windows-msvc.zip"; + curl -LO "https://github.com/ClementTsang/bottom/releases/download/${{ env.RELEASE_VERSION }}/bottom_x86_64-unknown-linux-gnu.tar.gz"; + curl -LO "https://github.com/ClementTsang/bottom/releases/download/${{ env.RELEASE_VERSION }}/bottom_x86_64-apple-darwin.tar.gz"; + curl -LO "https://github.com/ClementTsang/bottom/releases/download/${{ env.RELEASE_VERSION }}/bottom_i686-pc-windows-msvc.zip"; + curl -LO "https://github.com/ClementTsang/bottom/releases/download/${{ env.RELEASE_VERSION }}/bottom_x86_64-pc-windows-msvc.zip"; - name: Execute choco packaging script run: | - python "./deployment/windows/choco/choco_packager.py" "bottom_i686-pc-windows-msvc.zip" "bottom_x86_64-pc-windows-msvc.zip" $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" "bottom_i686-pc-windows-msvc.zip" "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/" zip -r choco.zip "bottom.nuspec" "tools" - name: Upload choco.zip to release @@ -362,7 +364,7 @@ jobs: - name: Execute Homebrew packaging script run: | - python "./deployment/packager.py" $RELEASE_VERSION "./deployment/macos/homebrew/bottom.rb.template" "./bottom.rb" "SHA256" "./bottom_x86_64-apple-darwin.tar.gz" "./bottom_x86_64-unknown-linux-gnu.tar.gz"; + python "./deployment/packager.py" ${{ env.RELEASE_VERSION }} "./deployment/macos/homebrew/bottom.rb.template" "./bottom.rb" "SHA256" "./bottom_x86_64-apple-darwin.tar.gz" "./bottom_x86_64-unknown-linux-gnu.tar.gz"; - name: Upload bottom.rb to release uses: actions/upload-release-asset@v1.0.1 diff --git a/.github/workflows/post-deploy.yml b/.github/workflows/post-deploy.yml index 425fe299..76c25ad6 100644 --- a/.github/workflows/post-deploy.yml +++ b/.github/workflows/post-deploy.yml @@ -1,4 +1,6 @@ -name: Update Packages +# A short amount of actions to run after releasing. This is mostly just to trigger other repos to run specific actions. + +name: post-deploy script on: release: diff --git a/deployment/windows/choco/choco_packager.py b/deployment/windows/choco/choco_packager.py index b8dbb633..1e5c5684 100644 --- a/deployment/windows/choco/choco_packager.py +++ b/deployment/windows/choco/choco_packager.py @@ -17,8 +17,8 @@ generated_ps1 = args[7] generated_ps1_dir = args[8] print("Generating Chocolatey package for:") -print(" 32-bit: %s", deployment_file_path_32) -print(" 64-bit: %s", deployment_file_path_64) +print(" 32-bit: %s" % deployment_file_path_32) +print(" 64-bit: %s" % deployment_file_path_64) print(" VERSION: %s" % version) print(" NUSPEC TEMPLATE: %s" % nuspec_template) print(" PS1 TEMPLATE: %s" % ps1_template) @@ -55,4 +55,3 @@ with open(deployment_file_path_32, "rb") as deployment_file_32, open( with open(generated_ps1, "w") as generated_file: generated_file.write(substitute) -