Skip to content

Commit da8f542

Browse files
committed
ci: publish to current repo
1 parent 7aadf7b commit da8f542

File tree

5 files changed

+26
-21
lines changed

5 files changed

+26
-21
lines changed

.github/scripts/create-versioned-mkdocs-config.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ VERSION="${1:-latest}"
55
# Function to generate download links for a specific version
66
generate_download_links() {
77
local version="$1"
8+
# Remove 'v' prefix from version for artifact names
9+
local version_no_v="${version#v}"
10+
811
if [ "$version" = "latest" ]; then
912
cat << EOF
1013
!!! info "Development Version"
1114
This is the latest development version of the documentation. For stable releases, please check the version selector above.
1215
13-
[📋 View all releases](https://github.com/mvach/ctRestClientSrc/releases)
16+
[📋 View all releases](https://github.com/mvach/ctRestClient/releases)
1417
EOF
1518
else
1619
cat << EOF
@@ -23,12 +26,12 @@ The following binaries are available for this version:
2326
2427
| Platform | Architecture | Download Link |
2528
|----------|--------------|---------------|
26-
| 🐧 Linux | x86_64 | [ctRestClient_${version}_linux_x86_64.tar.gz](https://github.com/mvach/ctRestClientSrc/releases/download/${version}/ctRestClient_${version}_linux_x86_64.tar.gz) |
27-
| 🍎 macOS | Intel (x86_64) | [ctRestClient_${version}_darwin_x86_64.tar.gz](https://github.com/mvach/ctRestClientSrc/releases/download/${version}/ctRestClient_${version}_darwin_x86_64.tar.gz) |
28-
| 🍎 macOS | Apple Silicon (ARM64) | [ctRestClient_${version}_darwin_arm64.tar.gz](https://github.com/mvach/ctRestClientSrc/releases/download/${version}/ctRestClient_${version}_darwin_arm64.tar.gz) |
29-
| 🪟 Windows | x86_64 | [ctRestClient_${version}_windows_x86_64.tar.gz](https://github.com/mvach/ctRestClientSrc/releases/download/${version}/ctRestClient_${version}_windows_x86_64.tar.gz) |
29+
| 🐧 Linux | x86_64 | [ctRestClient_${version_no_v}_linux_x86_64.tar.gz](https://github.com/mvach/ctRestClient/releases/download/${version}/ctRestClient_${version_no_v}_linux_x86_64.tar.gz) |
30+
| 🍎 macOS | Intel (x86_64) | [ctRestClient_${version_no_v}_darwin_x86_64.tar.gz](https://github.com/mvach/ctRestClient/releases/download/${version}/ctRestClient_${version_no_v}_darwin_x86_64.tar.gz) |
31+
| 🍎 macOS | Apple Silicon (ARM64) | [ctRestClient_${version_no_v}_darwin_arm64.tar.gz](https://github.com/mvach/ctRestClient/releases/download/${version}/ctRestClient_${version_no_v}_darwin_arm64.tar.gz) |
32+
| 🪟 Windows | x86_64 | [ctRestClient_${version_no_v}_windows_x86_64.tar.gz](https://github.com/mvach/ctRestClient/releases/download/${version}/ctRestClient_${version_no_v}_windows_x86_64.tar.gz) |
3033
31-
[📋 View all release assets](https://github.com/mvach/ctRestClientSrc/releases/tag/${version})
34+
[📋 View all release assets](https://github.com/mvach/ctRestClient/releases/tag/${version})
3235
EOF
3336
fi
3437
}

.github/workflows/release.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,17 @@ jobs:
4949
version: latest
5050
args: release --clean
5151
env:
52-
GITHUB_TOKEN: ${{ secrets.CTRESTCLIENT_PUBLISH }}
52+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5353

54-
deploy-versioned-docs:
54+
publish-versioned-docs:
5555
needs: release
5656
runs-on: ubuntu-latest
57+
permissions:
58+
contents: write
59+
pages: write
60+
id-token: write
5761
steps:
58-
- name: Checkout Source Repo
62+
- name: Checkout
5963
uses: actions/checkout@v4
6064
with:
6165
fetch-depth: 0
@@ -81,16 +85,14 @@ jobs:
8185
8286
- name: Configure Git for mike
8387
run: |
84-
git config --global user.name "${{ github.repository_owner }}"
85-
git config --global user.email "${{ github.repository_owner }}@users.noreply.github.com"
88+
git config user.name "${{ github.repository_owner }}"
89+
git config user.email "${{ github.repository_owner }}@users.noreply.github.com"
8690
8791
- name: Deploy versioned docs
8892
run: |
89-
git remote add target https://x-access-token:${{ secrets.CTRESTCLIENT_PUBLISH }}@github.com/mvach/ctRestClient.git
90-
git fetch target
91-
# Deploy the new version
92-
mike deploy --push --remote target --branch main ${{ steps.version.outputs.VERSION }} --title "${{ steps.version.outputs.VERSION }}" --update-aliases
93+
# Deploy the new version to gh-pages branch
94+
mike deploy --push ${{ steps.version.outputs.VERSION }} --title "${{ steps.version.outputs.VERSION }}" --update-aliases
9395
# Set this release as the new default (latest stable)
94-
mike set-default --push --remote target --branch main ${{ steps.version.outputs.VERSION }}
96+
mike set-default --push ${{ steps.version.outputs.VERSION }}
9597
env:
96-
GITHUB_TOKEN: ${{ secrets.CTRESTCLIENT_PUBLISH }}
98+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ archives:
4141
format: tar.gz
4242
name_template: >-
4343
{{ .ProjectName }}_
44-
{{- .Version }}_
44+
{{- printf "v%s" .Version }}_
4545
{{- .Os }}_
4646
{{- if eq .Arch "amd64" }}x86_64
4747
{{- else }}{{ .Arch }}{{ end }}
@@ -79,4 +79,4 @@ changelog:
7979
release:
8080
github:
8181
owner: mvach
82-
name: ctRestClientSrc
82+
name: ctRestClient

docs/manual-de.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
!!! info "Development Version"
44
This is the latest development version of the documentation. For stable releases, please check the version selector above.
55

6-
[📋 View all releases](https://github.com/mvach/ctRestClientSrc/releases)
6+
[📋 View all releases](https://github.com/mvach/ctRestClient/releases)
77

88

99
## Überblick

docs/manual-en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
!!! info "Development Version"
44
This is the latest development version of the documentation. For stable releases, please check the version selector above.
55

6-
[📋 View all releases](https://github.com/mvach/ctRestClientSrc/releases)
6+
[📋 View all releases](https://github.com/mvach/ctRestClient/releases)
77

88

99
## Overview

0 commit comments

Comments
 (0)