chore(deps): update actions/checkout action to v4.1.5 (#88) #31
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: CI | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
release: | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
permissions: | |
id-token: "write" | |
packages: "write" | |
name: release | |
runs-on: ubuntu-22.04 | |
outputs: | |
tag_name: ${{ steps.draft_release.outputs.tag_name }} | |
steps: | |
- name: Checkout action code | |
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
with: | |
fetch-depth: 0 | |
- name: Create GitHub App Token | |
id: app-token | |
uses: actions/create-github-app-token@a0de6af83968303c8c955486bf9739a57d23c7f1 # v1.10.0 | |
with: | |
app-id: ${{ secrets.VERSION_CLI_UPDATER_APP_ID }} | |
private-key: ${{ secrets.VERSION_CLI_UPDATER_PRIVATE_KEY }} | |
- name: Draft release | |
id: draft_release | |
uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0.0 | |
with: | |
disable-autolabeler: true | |
env: | |
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build Docker image | |
run: VERSION=${{ steps.draft_release.outputs.tag_name }} make docker-push | |
- name: Publish release | |
uses: release-drafter/release-drafter@3f0f87098bd6b5c5b9a36d49c41d998ea58f9348 # v6.0.0 | |
if: steps.draft_release.outputs.tag_name != '' | |
with: | |
version: ${{ steps.draft_release.outputs.tag_name }} | |
publish: true | |
disable-autolabeler: true | |
env: | |
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
- name: Checkout action code | |
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
with: | |
fetch-depth: 0 | |
ref: ${{ steps.draft_release.outputs.tag_name }} | |
- name: Setup Go environment | |
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 | |
with: | |
go-version-file: "go.mod" | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 # v5.0.0 | |
with: | |
version: v1.25.1 # renovate: datasource=github-tags depName=goreleaser/goreleaser | |
args: release --skip=publish --clean | |
env: | |
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
GORELEASER_CURRENT_TAG: ${{ steps.draft_release.outputs.tag_name }} | |
- name: Upload files | |
run: | | |
gh release upload --clobber ${{ env.VERSION }} ${{ env.FILES }} | |
env: | |
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} | |
VERSION: ${{ steps.draft_release.outputs.tag_name }} | |
FILES: dist/version_*.tar.gz dist/version_*.zip dist/version_*_checksums.txt | |
docs-deploy: | |
runs-on: ubuntu-22.04 | |
if: ${{ always() }} | |
needs: release | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5 | |
with: | |
fetch-depth: 0 | |
- name: Configure Git Credentials | |
run: | | |
git config user.name version-cli[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
- name: Install Poetry | |
# renovate: datasource=github-tags depName=poetry packageName=python-poetry/poetry | |
run: pipx install poetry==1.8.2 | |
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5 | |
with: | |
python-version-file: pyproject.toml | |
cache: "poetry" | |
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
- run: poetry install --no-interaction | |
- name: Fetch gh-pages remote changes (if any) | |
run: git fetch origin gh-pages --depth=1 | |
- name: Deploy main docs | |
if: ${{ github.event_name == 'push' && github.event.ref == 'refs/heads/main' }} | |
run: poetry run mike deploy --push main | |
env: | |
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} | |
MKDOCS_GIT_COMMITTERS_APIKEY: ${{ github.token }} | |
EXCLUDE_SHIELDS_IO_PRIVACY: true | |
- name: Deploy release docs | |
if: ${{ github.event_name == 'workflow_dispatch' && needs.release.result == 'success' }} | |
run: |- | |
FULL_TAG="${{ needs.release.outputs.tag_name }}" | |
TAG=$(echo "$FULL_TAG" | sed 's/\.[0-9]*$/\.x/') | |
poetry run mike deploy --push --update-aliases ${{ needs.release.outputs.tag_name }} latest | |
env: | |
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} | |
MKDOCS_GIT_COMMITTERS_APIKEY: ${{ github.token }} |