From 2fc1d4b13e37c1362089701914b43ce285949e76 Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Halili Date: Mon, 22 Jul 2024 01:32:13 +0800 Subject: [PATCH] ci(github-actions): automate running "yarn-upgrade-all" on Saturdays Also add Zed editor configs and .envrc for maintainer scripts. Signed-off-by: Andrei Jiroh Halili --- .envrc | 4 ++ .github/workflows/automated-bumps.md | 1 + .github/workflows/bump-all-packages.yml | 51 +++++++++++++++++++++++++ .zed/settings.json | 18 +++++++++ 4 files changed, 74 insertions(+) create mode 100644 .envrc create mode 100644 .github/workflows/automated-bumps.md create mode 100644 .github/workflows/bump-all-packages.yml create mode 100644 .zed/settings.json diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..7946406 --- /dev/null +++ b/.envrc @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +export GIT_ROOTDIR=$(git rev-parse --show-toplevel) +export PATH="$PATH:${GIT_ROOTDIR}/scripts" diff --git a/.github/workflows/automated-bumps.md b/.github/workflows/automated-bumps.md new file mode 100644 index 0000000..ec23eff --- /dev/null +++ b/.github/workflows/automated-bumps.md @@ -0,0 +1 @@ +See the changed manifest and lockfiles for details. diff --git a/.github/workflows/bump-all-packages.yml b/.github/workflows/bump-all-packages.yml new file mode 100644 index 0000000..452db35 --- /dev/null +++ b/.github/workflows/bump-all-packages.yml @@ -0,0 +1,51 @@ +name: Bump all packages +on: + workflow_dispatch: + schedule: + - cron: 30 12 * * 6 +permissions: + contents: write + pull-requests: write + +jobs: + main: + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + node-version: 20 + - name: Setup Git + id: init-env + run: | + timestamp=$(date +%s) + git config --global user.name "ajhalili2006-bot" + git config --global user.email "bot@andreijiroh.xyz" + git switch -c bump-everything/yarn-$(date +%s) + echo timestamp=$timestamp >> "$GITHUB_OUTPUT" + - name: Get secrets with dotenvx + uses: andreijiroh-dev/dotenvx-action@main + id: dotenvx + with: + key: ${{ secrets.DOTENV_PRIVATE_KEY_CI }} + path: .env.ci + - name: Update lockfile + run: | + yarn install --mode=update-lockfile --refresh-lockfile + yarn install + - name: Bump to latest version + run: | + yarn yarn-upgrade-all + yarn workspace @andreijiroh-dev/golinks-rewrite yarn-upgrade-all + - name: Commit and push + run: | + git commit --signoff "chore(global): update yarn packages [skip ci]" + git push + gh pr create \ + --title "chore(automation): bump all yarn packages as of ${{ steps.init-env.outputs.timestamp }}" \ + --body-file .github/workflows/automated-bumps.md \ + --assignee ajhalili2006 \ + --base main + env: + GITHUB_TOKEN: ${{ steps.dotenvx.outputs.GH_BOT_TOKEN }} diff --git a/.zed/settings.json b/.zed/settings.json new file mode 100644 index 0000000..dcbc654 --- /dev/null +++ b/.zed/settings.json @@ -0,0 +1,18 @@ +// Folder-specific settings +// +// For a full list of overridable settings, and general information on folder-specific settings, +// see the documentation: https://zed.dev/docs/configuring-zed#folder-specific-settings +{ + "autosave": { + "after_delay": { + "milliseconds": 10000 + } + }, + "format_on_save": "language_server", + "formatter": "prettier", + "tab_size": 2, + "hard_tabs": false, + "tabs": { + "git_status": true + } +} -- 2.51.2