Add actionlint to testing pipelines (#1555)

* add actionlint for github actions to testing suite

* add quotes around vars per shellcheck

* change expression per shellcheck

* put more quotes around vars per shellcheck

* put quotes around entire string

* use find instead of ls to better handle non-alphanumberic filenames

* update release workflow input types to have actual typese and fix typo
This commit is contained in:
Jonathan Wren 2022-08-21 13:59:45 -07:00 committed by GitHub
parent fd981216da
commit 803b3956fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 22 deletions

View file

@ -7,17 +7,21 @@ on:
inputs:
version:
description: 'Version (e.g. v2.5, v2.5.1-beta, v2.6-beta2)'
type: string
required: true
include_repo_version:
description: 'Update version in repo? (true/false)'
require: true
type: boolean
required: true
default: true
include_pypi:
description: 'Publish to PyPI? (true/false)'
type: boolean
required: true
default: true
include_brew:
description: 'Publish to Homebrew? (true/false)'
type: boolean
required: true
default: true
@ -59,7 +63,7 @@ jobs:
run: |
JRNL_VERSION="${{ github.event.inputs.version }}"
echo "::debug::version: $JRNL_VERSION"
echo "JRNL_VERSION=$JRNL_VERSION" >> $GITHUB_ENV
echo "JRNL_VERSION=$JRNL_VERSION" >> "$GITHUB_ENV"
- name: Set up Python
uses: actions/setup-python@v2
@ -83,7 +87,7 @@ jobs:
if: ${{ github.event.inputs.include_repo_version == 'true' }}
run: |
poetry version "$JRNL_VERSION"
echo __version__ = \"$JRNL_VERSION\" > jrnl/__version__.py
echo "__version__ = \"$JRNL_VERSION\"" > jrnl/__version__.py
- name: Commit updated files
if: ${{ github.event.inputs.include_repo_version == 'true' && github.repository == env.HOME_REPO }}
@ -106,7 +110,7 @@ jobs:
- name: Get PyPI version
id: pypi-version-getter
run: |
pypi_version="$(ls dist/jrnl-*.tar.gz | sed -r 's!dist/jrnl-(.*)\.tar\.gz!\1!')"
pypi_version="$(find dist/jrnl-*.tar.gz | sed -r 's!dist/jrnl-(.*)\.tar\.gz!\1!')"
echo "::set-output name=pypi_version::$pypi_version"
release_homebrew:
@ -127,8 +131,8 @@ jobs:
echo "::debug::jrnl version: $JRNL_VERSION"
echo "::debug::pypi version: $PYPI_VERSION"
echo "JRNL_VERSION=$JRNL_VERSION" >> $GITHUB_ENV
echo "PYPI_VERSION=$PYPI_VERSION" >> $GITHUB_ENV
echo "JRNL_VERSION=$JRNL_VERSION" >> "$GITHUB_ENV"
echo "PYPI_VERSION=$PYPI_VERSION" >> "$GITHUB_ENV"
- name: Set env variables
env:
@ -141,7 +145,7 @@ jobs:
echo "FORMULA_REPO=${REPO_OWNER}/homebrew-prerelease"
echo "BOT_REPO=jrnl-bot/homebrew-prerelease"
echo "FORMULA_NAME=jrnl-beta"
} >> $GITHUB_ENV
} >> "$GITHUB_ENV"
else
echo '::debug::Full release (not a prerelease)'
if [[ "${{ github.repository }}" == "${HOME_REPO}" ]]; then
@ -152,14 +156,14 @@ jobs:
echo "FORMULA_REPO=${REPO_OWNER}/homebrew-core"
echo "BOT_REPO=jrnl-bot/homebrew-core"
echo "FORMULA_NAME=jrnl"
} >> $GITHUB_ENV
} >> "$GITHUB_ENV"
fi
- name: Tap formula
run: |
brew tap ${FORMULA_REPO}
brew tap "${FORMULA_REPO}"
echo '::debug::Set tap directory'
echo "BREW_TAP_DIRECTORY=$(brew --repo ${FORMULA_REPO})" >> $GITHUB_ENV
echo "BREW_TAP_DIRECTORY=$(brew --repo "${FORMULA_REPO}")" >> "$GITHUB_ENV"
- name: Install dependencies
run: brew install pipgrip