Update libvips, aws-cli and open-lens modules #334
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto update | |
on: | |
pull_request: | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Setup environment variables | |
run: | | |
echo "FLATPAK_BUILDER_TOOLS_DIR=/tmp/flatpak-builder-tools" >> $GITHUB_ENV | |
echo "OPEN_LENS_VERSION="$(yq '.modules[-1].sources[0].tag' 'dev.k8slens.OpenLens.yml')"" >> $GITHUB_ENV | |
- name: Setup flatpak-builder-tools | |
run: | | |
git clone --depth=1 https://github.com/flatpak/flatpak-builder-tools ${FLATPAK_BUILDER_TOOLS_DIR} | |
pip install --user pipx && pipx install ${FLATPAK_BUILDER_TOOLS_DIR}/node | |
pip install --user toml aiohttp | |
- name: Fetch the latest codebase | |
run: | | |
git clone https://github.com/lensapp/lens.git --depth=1 --branch=${OPEN_LENS_VERSION} /tmp/lens | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
registry-url: 'https://npm.pkg.github.com' | |
- name: Regenerate package-lock.json | |
run: | | |
cp package-lock.json /tmp/lens/package-lock.json | |
pushd /tmp/lens | |
sed -i -e '/"engines":/{n;d}' package.json | |
npm install -g [email protected] | |
npm install | |
popd | |
cp /tmp/lens/package-lock.json . | |
git add package-lock.json | |
echo "PACKAGE_LOCK_CHANGED=$(git diff --exit-code package-lock.json)" >> $GITHUB_ENV | |
- name: Update Node.js generated sources | |
if: env.PACKAGE_LOCK_CHANGED == 1 | |
run: | | |
flatpak-node-generator --electron-node-headers --recursive npm /tmp/lens/package-lock.json -o generated-sources.json | |
git add generated-sources.json | |
- name: Commit updates | |
if: env.PACKAGE_LOCK_CHANGED == 1 | |
run: | | |
set -e | |
[[ ! $(git status --porcelain) ]] && exit 0 | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git config user.name "Workflow trigger" | |
git commit -m 'Update generated sources' | |
git push https://${GITHUB_ACTOR}:${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY} |