2
0
Fork 0
mirror of https://github.com/ClementTsang/bottom synced 2025-02-23 00:28:30 +00:00

ci: Fix some bugs/typos with the deploy script and components ()

- 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:
Clement Tsang 2020-11-26 03:28:56 -05:00 committed by GitHub
parent cfa4e5eb99
commit 380571cf73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 34 additions and 29 deletions
.github/workflows
deployment/windows/choco

View file

@ -1,4 +1,4 @@
name: cargo-audit check
name: audit
on:
schedule:
- cron: "0 5 * * *"

View file

@ -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

View file

@ -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

View file

@ -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:

View file

@ -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)