From de1ea49462b9c5ed2d950522602448782d5eecb6 Mon Sep 17 00:00:00 2001 From: Tiago de Paula Date: Sat, 12 Jul 2025 20:10:35 -0300 Subject: [PATCH 1/2] ci: update to actions/checkout@v4 Also update to ludeeus/action-shellcheck@2.0.0 --- .github/workflows/installer-sync.yml | 2 +- .github/workflows/shellcheck.yml | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/installer-sync.yml b/.github/workflows/installer-sync.yml index bbb23c88..0c38cf3a 100644 --- a/.github/workflows/installer-sync.yml +++ b/.github/workflows/installer-sync.yml @@ -10,7 +10,7 @@ jobs: installer-sync: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Check nanorc included every *nanorc files run: | diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 8f7ee1f7..cd5e428d 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -10,22 +10,20 @@ jobs: shellcheck: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: ShellCheck - uses: ludeeus/action-shellcheck@1.1.0 + uses: ludeeus/action-shellcheck@2.0.0 #with: # A space separated list of additional filename to check - #additional_files: # optional, default is + #additional_files: # optional, default is '' # Paths to ignore when running ShellCheck - #ignore: # optional, default is + #ignore_paths: # optional, default is '' # Minimum severity of errors to consider. Options: [error, warning, info, style] - #severity: # optional, default is + #severity: # optional, default is '' # Run shellcheck on _all_ files at once, instead of one at a time - #check_together: # optional, default is + #check_together: # optional, default is '' # Directory to be searched for files. Defaults to . #scandir: # optional, default is . - # Set to true to skip using problem-matcher - #disable_matcher: # optional, default is false # Output format (checkstyle, diff, gcc, json, json1, quiet, tty) #format: # optional, default is gcc From ff8ff704801627f480a987f6ed180efb37ad1166 Mon Sep 17 00:00:00 2001 From: Tiago de Paula Date: Sun, 13 Jul 2025 07:18:26 -0300 Subject: [PATCH 2/2] ci: automatic releases --- .github/workflows/release.yml | 95 +++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..604c9303 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,95 @@ +name: release + +on: + schedule: + - cron: '0 0 1 */1 *' # @monthly + workflow_dispatch: + inputs: + release_tag: + type: string + required: false + environment: + type: environment + required: true + default: release + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + verify: + runs-on: ubuntu-latest + outputs: + release_tag: ${{ steps.verify.outputs.release_tag }} + release_commit: ${{ steps.verify.outputs.release_commit }} + steps: + - uses: actions/checkout@v4 + with: + fetch-tags: true + # FIXME: workaround for git 2.48, see https://github.com/actions/checkout/issues/1467 + fetch-depth: 100 + ref: ${{ github.ref }} + + - name: Verify release tag + id: verify + env: + INPUT_RELEASE_TAG: ${{ inputs.release_tag }} + REPOSITORY_URL: '${{ github.server_url }}/${{ github.repository }}' + run: | + set -eu + + latest_tag="$(git describe --tags --abbrev=0)" + latest_tag_fmt="[\`${latest_tag}\`](${REPOSITORY_URL}/releases/tag/${latest_tag})" + release_tag="${INPUT_RELEASE_TAG:-$(date +'%Y.%m.%d')}" + release_commit="$(git log --format="%H" -n 1)" + + # note: this comparison only works with lexicographic dates + if [[ ! "${release_tag}" > "${latest_tag}" ]]; then + echo "## Skipping release \`${release_tag}\`" >> "$GITHUB_STEP_SUMMARY" + echo "Latest tag ${latest_tag_fmt} already covers this date." >> "$GITHUB_STEP_SUMMARY" + exit 0 + elif [[ "$(git log --format="%H" -n 1 "${latest_tag}")" = "${release_commit}" ]]; then + echo "## Skipping release \`${release_tag}\`" >> "$GITHUB_STEP_SUMMARY" + echo "No changes since ${latest_tag_fmt}." >> "$GITHUB_STEP_SUMMARY" + exit 0 + fi + + { + echo "## Proposing new release \`${release_tag}\`" + echo "Commit: [${release_commit}](${REPOSITORY_URL}/commit/${release_commit})" + + echo "### Changes since ${latest_tag_fmt}" + echo '```log' + git diff --histogram --stat "${latest_tag}..${release_commit}" + echo '```' + + echo '### Git log' + echo '```log' + git log --no-merges "${latest_tag}..${release_commit}" + echo '```' + } >> "$GITHUB_STEP_SUMMARY" + + echo "release_tag=${release_tag}" >> "$GITHUB_OUTPUT" + echo "release_commit=${release_commit}" >> "$GITHUB_OUTPUT" + + release: + runs-on: ubuntu-latest + needs: [verify] + if: needs.verify.outputs.release_tag != '' + environment: ${{ inputs.environment || 'release' }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ needs.verify.outputs.release_commit }} + + - name: Create release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ needs.verify.outputs.release_tag }} + name: ${{ needs.verify.outputs.release_tag }} + target_commitish: ${{ needs.verify.outputs.release_commit }} + generate_release_notes: true + make_latest: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}