fix: change the domain from ghproxy.com to gh-proxy.com (#440) #99
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
goreleaser: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Unshallow | |
run: git fetch --prune --unshallow | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.18 | |
- name: Image Registry Login | |
run: | | |
docker login --username ${{ secrets.DOCKER_HUB_USER }} --password ${{secrets.DOCKER_HUB_TOKEN}} | |
docker login ghcr.io/linuxsuren --username linuxsuren --password ${{secrets.GH_PUBLISH_SECRETS}} | |
- name: Run GoReleaser | |
uses: goreleaser/[email protected] | |
with: | |
github_token: ${{ secrets.GH_PUBLISH_SECRETS }} | |
version: v1.14.0 | |
args: release --rm-dist | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_PUBLISH_SECRETS }} | |
msi: | |
needs: goreleaser | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Download hd.exe | |
id: download_exe | |
shell: bash | |
run: | | |
hub release download "${GITHUB_REF#refs/tags/}" -i '*windows-amd64*.zip' | |
printf "::set-output name=zip::%s\n" *.zip | |
unzip -o *.zip && rm -v *.zip | |
env: | |
GITHUB_TOKEN: ${{secrets.GH_PUBLISH_SECRETS}} | |
- name: Install go-msi | |
run: choco install -y "go-msi" | |
- name: Prepare PATH | |
shell: bash | |
run: | | |
echo "$WIX\\bin" >> $GITHUB_PATH | |
echo "C:\\Program Files\\go-msi" >> $GITHUB_PATH | |
- name: Build MSI | |
id: buildmsi | |
shell: bash | |
env: | |
ZIP_FILE: ${{ steps.download_exe.outputs.zip }} | |
run: | | |
mkdir -p build | |
msi="$(basename "$ZIP_FILE" ".zip").msi" | |
printf "::set-output name=msi::%s\n" "$msi" | |
go-msi make --msi "$PWD/$msi" --out "$PWD/build" --version "${GITHUB_REF#refs/tags/}" | |
- name: Upload MSI | |
shell: bash | |
run: | | |
tag_name="${GITHUB_REF#refs/tags/}" | |
hub release edit "$tag_name" -m "" -a "$MSI_FILE" | |
release_url="$(gh api repos/:owner/:repo/releases -q ".[]|select(.tag_name==\"${tag_name}\")|.url")" | |
publish_args=( -F draft=false ) | |
if [[ $GITHUB_REF != *-* ]]; then | |
publish_args+=( -f discussion_category_name="$DISCUSSION_CATEGORY" ) | |
fi | |
gh api -X PATCH "$release_url" "${publish_args[@]}" | |
env: | |
MSI_FILE: ${{ steps.buildmsi.outputs.msi }} | |
DISCUSSION_CATEGORY: General | |
GITHUB_TOKEN: ${{secrets.GH_PUBLISH_SECRETS}} |