ci: update git config username #42
Workflow file for this run
This file contains hidden or 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
| # This workflow will build a golang project and create releases | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.23' | |
| - name: Install keepassxc-cli | |
| run: sudo apt-get update && sudo apt-get install -y keepassxc | |
| - name: Build | |
| run: go build | |
| - name: Test | |
| run: go test ./... | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| with: | |
| go-version: '1.23' | |
| - name: Run GoReleaser | |
| uses: goreleaser/goreleaser-action@v5 | |
| with: | |
| distribution: goreleaser | |
| version: latest | |
| args: release --clean | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.CTRESTCLIENT_PUBLISH }} | |
| deploy-versioned-docs: | |
| needs: release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Source Repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| fetch-tags: true | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install MkDocs and dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install mkdocs mkdocs-material mike | |
| - name: Extract version from tag | |
| id: version | |
| run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Create versioned MkDocs config | |
| run: | | |
| bash .github/scripts/create-versioned-mkdocs-config.sh ${{ steps.version.outputs.VERSION }} | |
| - name: Configure Git for mike | |
| run: | | |
| git config --global user.name "${{ github.repository_owner }}" | |
| git config --global user.email "${{ github.repository_owner }}@users.noreply.github.com" | |
| - name: Deploy versioned docs | |
| run: | | |
| git remote add target https://x-access-token:${{ secrets.CTRESTCLIENT_PUBLISH }}@github.com/mvach/ctRestClient.git | |
| git fetch target | |
| # Deploy the new version | |
| mike deploy --push --remote target --branch main ${{ steps.version.outputs.VERSION }} --title "${{ steps.version.outputs.VERSION }}" --update-aliases | |
| # Set this release as the new default (latest stable) | |
| mike set-default --push --remote target --branch main ${{ steps.version.outputs.VERSION }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.CTRESTCLIENT_PUBLISH }} |