mirror of
https://github.com/ClementTsang/bottom.git
synced 2025-07-29 16:44:54 +02:00
ci: Fix some bugs/typos with the deploy script and components (#329)
- Fix bug with choco and homebrew using incorrect bash syntax causing broken downloads. Why this didn't fail, idk. - Add tag entry for manual runs to make it easier to deploy/re-run - Fixed some typos - Fixed incorrect string in choco python script
This commit is contained in:
parent
cfa4e5eb99
commit
380571cf73
2
.github/workflows/audit.yml
vendored
2
.github/workflows/audit.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: cargo-audit check
|
name: audit
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 5 * * *"
|
- cron: "0 5 * * *"
|
||||||
|
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@ -1,3 +1,5 @@
|
|||||||
|
# Main CI pipeline to validate PRs.
|
||||||
|
#
|
||||||
# CI pipeline based on:
|
# CI pipeline based on:
|
||||||
# - https://github.com/heim-rs/heim/blob/master/.github/workflows/ci.yml
|
# - https://github.com/heim-rs/heim/blob/master/.github/workflows/ci.yml
|
||||||
# - https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/ci.yml
|
# - https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/ci.yml
|
||||||
|
50
.github/workflows/deployment.yml
vendored
50
.github/workflows/deployment.yml
vendored
@ -1,3 +1,5 @@
|
|||||||
|
# How we deploy a release. Covers binary builds. Also manages packaging for AUR, winget, choco, and homebrew.
|
||||||
|
#
|
||||||
# Based on:
|
# Based on:
|
||||||
# - https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml
|
# - https://github.com/BurntSushi/ripgrep/blob/master/.github/workflows/release.yml
|
||||||
|
|
||||||
@ -5,6 +7,10 @@ name: deployment
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: "Which tag to test against."
|
||||||
|
required: true
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- "[0-9]+.[0-9]+.[0-9]+"
|
- "[0-9]+.[0-9]+.[0-9]+"
|
||||||
@ -17,21 +23,19 @@ jobs:
|
|||||||
- name: Create artifacts directory
|
- name: Create artifacts directory
|
||||||
run: mkdir artifacts
|
run: mkdir artifacts
|
||||||
|
|
||||||
# TODO: Make this easier to test with.
|
|
||||||
|
|
||||||
- name: Get the release version from the tag
|
- name: Get the release version from the tag
|
||||||
if: env.VERSION == ''
|
if: env.VERSION == ''
|
||||||
run: |
|
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
|
- name: Validate version environment variable
|
||||||
# if: env.VERSION == ''
|
|
||||||
# run: |
|
|
||||||
# echo "VERSION=0.5.1" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Validate the release version from the tag
|
|
||||||
run: |
|
run: |
|
||||||
echo "Version is: ${{ env.VERSION }}"
|
echo "Version being built against is version ${{ env.VERSION }}"!
|
||||||
|
|
||||||
- name: Create GitHub release
|
- name: Create GitHub release
|
||||||
id: release
|
id: release
|
||||||
@ -142,11 +146,10 @@ jobs:
|
|||||||
release_version="$(cat ./artifacts/release-version)"
|
release_version="$(cat ./artifacts/release-version)"
|
||||||
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
|
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Check release upload URL and release version
|
- name: Validate release environment variables
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
echo "release upload url: $RELEASE_UPLOAD_URL"
|
echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}"
|
||||||
echo "release version: $RELEASE_VERSION"
|
echo "Release version: ${{ env.RELEASE_VERSION }}"
|
||||||
|
|
||||||
- name: Install Net-Framework-Core (Windows x86-64 MSVC)
|
- name: Install Net-Framework-Core (Windows x86-64 MSVC)
|
||||||
if: matrix.triple.target == 'x86_64-pc-windows-msvc'
|
if: matrix.triple.target == 'x86_64-pc-windows-msvc'
|
||||||
@ -332,22 +335,21 @@ jobs:
|
|||||||
release_version="$(cat ./artifacts/release-version)"
|
release_version="$(cat ./artifacts/release-version)"
|
||||||
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
|
echo "RELEASE_VERSION=$release_version" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Check release upload URL and release version
|
- name: Validate release environment variables
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
echo "release upload url: $RELEASE_UPLOAD_URL"
|
echo "Release upload url: ${{ env.RELEASE_UPLOAD_URL }}"
|
||||||
echo "release version: $RELEASE_VERSION"
|
echo "Release version: ${{ env.RELEASE_VERSION }}"
|
||||||
|
|
||||||
- name: Download packages
|
- name: Download packages
|
||||||
run: |
|
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/${{ env.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/${{ env.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/${{ env.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-pc-windows-msvc.zip";
|
||||||
|
|
||||||
- name: Execute choco packaging script
|
- name: Execute choco packaging script
|
||||||
run: |
|
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"
|
zip -r choco.zip "bottom.nuspec" "tools"
|
||||||
|
|
||||||
- name: Upload choco.zip to release
|
- name: Upload choco.zip to release
|
||||||
@ -362,7 +364,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Execute Homebrew packaging script
|
- name: Execute Homebrew packaging script
|
||||||
run: |
|
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
|
- name: Upload bottom.rb to release
|
||||||
uses: actions/upload-release-asset@v1.0.1
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
4
.github/workflows/post-deploy.yml
vendored
4
.github/workflows/post-deploy.yml
vendored
@ -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:
|
on:
|
||||||
release:
|
release:
|
||||||
|
@ -17,8 +17,8 @@ generated_ps1 = args[7]
|
|||||||
generated_ps1_dir = args[8]
|
generated_ps1_dir = args[8]
|
||||||
|
|
||||||
print("Generating Chocolatey package for:")
|
print("Generating Chocolatey package for:")
|
||||||
print(" 32-bit: %s", deployment_file_path_32)
|
print(" 32-bit: %s" % deployment_file_path_32)
|
||||||
print(" 64-bit: %s", deployment_file_path_64)
|
print(" 64-bit: %s" % deployment_file_path_64)
|
||||||
print(" VERSION: %s" % version)
|
print(" VERSION: %s" % version)
|
||||||
print(" NUSPEC TEMPLATE: %s" % nuspec_template)
|
print(" NUSPEC TEMPLATE: %s" % nuspec_template)
|
||||||
print(" PS1 TEMPLATE: %s" % ps1_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:
|
with open(generated_ps1, "w") as generated_file:
|
||||||
generated_file.write(substitute)
|
generated_file.write(substitute)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user