forked from v2rayA/v2rayA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add version number to filename ci: windows version should be win10 at least chore(docker): Publish docker images on Github Container Registry (v2rayA#1425) * Temporary test * Push containers to ghcr.io via GitHub Actions * replace tabs with spaces * temporary comment out dockerhub * temporary comment out dockerhub for gui * revertme: remove non-ghcr docker image tags * convert repo owner name to lowercase * fix conversion to lowercase * fix typo, move lowercase conversion to calculate sooner * copy lowercase conversion to both jobs * fix typo * add labels to gui and dev Dockerfiles * specify correct push path for the ghcr.io * fix typo * hardcode image name * specify correct labels for upstream * add dockerhub tags * uncomment dockerhub login * restore Dockerfile.dev
- Loading branch information
Markson Hon
authored and
Markson Hon
committed
Jun 19, 2024
1 parent
e253122
commit 2d2c3a5
Showing
6 changed files
with
53 additions
and
15 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,44 +95,52 @@ jobs: | |
shell: pwsh | ||
run: | | ||
New-Item -ItemType Directory -Path v2raya_binaries | ||
foreach ($arch in @('amd64', 'arm64', 'arm', '386', 'riscv64', 'mips64', 'mips64le', 'mipsle', 'mips', 'loong64')) { | ||
Set-Location -Path service | ||
foreach ($arch in @('amd64', 'arm64', '386', 'riscv64', 'mips64', 'mips64le', 'mipsle', 'mips', 'loong64')) { | ||
$env:GOARCH = $arch | ||
$filename = $((Get-Content ./install/friendly-filenames.json | ConvertFrom-Json)."linux-$arch")."friendlyName" | ||
go build -o ../v2raya_binaries/v2raya_$filename -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path service | ||
go build -o ../v2raya_binaries/v2raya_${filename}_${env:VERSION} -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path .. | ||
} | ||
foreach ($arm in @('7')) { | ||
Set-Location -Path service | ||
$env:GOARCH = 'arm' | ||
$env:GOARM = $arm | ||
$filename = $((Get-Content ./install/friendly-filenames.json | ConvertFrom-Json)."linux-arm$arm")."friendlyName" | ||
go build -o ../v2raya_binaries/v2raya_$filename -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path service | ||
go build -o ../v2raya_binaries/v2raya_${filename}_${env:VERSION} -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path .. | ||
} | ||
foreach ($arch in @('amd64', 'arm64')) { | ||
$env:GOOS = 'windows' | ||
$env:GOARCH = $arch | ||
$filename = $((Get-Content ./install/friendly-filenames.json | ConvertFrom-Json)."windows-$arch")."friendlyName" | ||
go build -o ../v2raya_binaries/v2raya_$filename.exe -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path service | ||
go build -o ../v2raya_binaries/v2raya_${filename}_${env:VERSION}.exe -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path .. | ||
} | ||
foreach ($arch in @('amd64', 'arm64')) { | ||
$env:GOOS = 'darwin' | ||
$env:GOARCH = $arch | ||
$filename = $((Get-Content ./install/friendly-filenames.json | ConvertFrom-Json)."darwin-$arch")."friendlyName" | ||
go build -o ../v2raya_binaries/v2raya_$filename -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path service | ||
go build -o ../v2raya_binaries/v2raya_${filename}_${env:VERSION} -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path .. | ||
} | ||
foreach ($arch in @('amd64', 'arm64')) { | ||
$env:GOOS = 'freebsd' | ||
$env:GOARCH = $arch | ||
$filename = $((Get-Content ./install/friendly-filenames.json | ConvertFrom-Json)."freebsd-$arch")."friendlyName" | ||
go build -o ../v2raya_binaries/v2raya_$filename -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path service | ||
go build -o ../v2raya_binaries/v2raya_${filename}_${env:VERSION} -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path .. | ||
} | ||
foreach ($arch in @('amd64', 'arm64')) { | ||
$env:GOOS = 'openbsd' | ||
$env:GOARCH = $arch | ||
$filename = $((Get-Content ./install/friendly-filenames.json | ConvertFrom-Json)."openbsd-$arch")."friendlyName" | ||
go build -o ../v2raya_binaries/v2raya_$filename -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path service | ||
go build -o ../v2raya_binaries/v2raya_${filename}_${env:VERSION}_${env:VERSION} -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path .. | ||
} | ||
- name: Upload Artifact | ||
|
@@ -186,23 +194,27 @@ jobs: | |
run: | | ||
New-Item -ItemType Directory -Path v2raya_binaries | ||
foreach ($arch in @('amd64', 'arm64')) { | ||
Set-Location -Path service | ||
$env:GOARCH = $arch | ||
$filename = $((Get-Content ./install/friendly-filenames.json | ConvertFrom-Json)."linux-$arch")."friendlyName" | ||
go build -tags "with_gvisor" -o ../v2raya_binaries/v2raya_with_singtun_$filename -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path service | ||
go build -tags "with_gvisor" -o ../v2raya_binaries/v2raya_with_singtun_${filename}_${env:VERSION} -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path .. | ||
} | ||
foreach ($arch in @('amd64', 'arm64')) { | ||
$env:GOOS = 'windows' | ||
$env:GOARCH = $arch | ||
$filename = $((Get-Content ./install/friendly-filenames.json | ConvertFrom-Json)."windows-$arch")."friendlyName" | ||
go build -tags "with_gvisor" -o ../v2raya_binaries/v2raya_with_singtun_$filename.exe -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path service | ||
go build -tags "with_gvisor" -o ../v2raya_binaries/v2raya_with_singtun_${filename}_${env:VERSION}.exe -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path .. | ||
} | ||
foreach ($arch in @('amd64', 'arm64')) { | ||
$env:GOOS = 'darwin' | ||
$env:GOARCH = $arch | ||
$filename = $((Get-Content ./install/friendly-filenames.json | ConvertFrom-Json)."darwin-$arch")."friendlyName" | ||
go build -tags "with_gvisor" -o ../v2raya_binaries/v2raya_with_singtun_$filename -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path service | ||
go build -tags "with_gvisor" -o ../v2raya_binaries/v2raya_with_singtun_${filename}_${env:VERSION} -ldflags="-X github.com/v2rayA/v2rayA/conf.Version=${env:VERSION} -s -w" -trimpath | ||
Set-Location -Path .. | ||
} | ||
- name: Upload Artifact | ||
uses: nanoufo/action-upload-artifacts-and-release-assets@v2 | ||
|
@@ -808,11 +820,20 @@ jobs: | |
uses: docker/[email protected] | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: Login to GitHub container registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Convert repository owner to lowercase | ||
run: | | ||
echo "LOWERCASE_REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER@L}" >>${GITHUB_ENV} | ||
- name: Build and push | ||
uses: docker/[email protected] | ||
with: | ||
|
@@ -824,6 +845,8 @@ jobs: | |
tags: | | ||
${{ steps.prep.outputs.image }}:${{ steps.prep.outputs.tag }} | ||
${{ steps.prep.outputs.image }}:latest | ||
ghcr.io/${{ env.LOWERCASE_REPOSITORY_OWNER }}/v2raya:${{ steps.prep.outputs.tag }} | ||
ghcr.io/${{ env.LOWERCASE_REPOSITORY_OWNER }}/v2raya:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
Release_v2rayA_GUI_to_Docker: | ||
|
@@ -853,11 +876,20 @@ jobs: | |
uses: docker/[email protected] | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: Login to GitHub container registry | ||
uses: docker/[email protected] | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Login to DockerHub | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- name: Convert repository owner to lowercase | ||
run: | | ||
echo "LOWERCASE_REPOSITORY_OWNER=${GITHUB_REPOSITORY_OWNER@L}" >>${GITHUB_ENV} | ||
- name: Build and push | ||
uses: docker/[email protected] | ||
with: | ||
|
@@ -866,7 +898,9 @@ jobs: | |
file: install/docker/Dockerfile.GUI.Action | ||
platforms: linux/arm,linux/arm64,linux/amd64 | ||
push: true | ||
tags: mzz2017/v2raya-gui:latest | ||
tags: | | ||
mzz2017/v2raya-gui:latest | ||
ghcr.io/${{ env.LOWERCASE_REPOSITORY_OWNER }}/v2raya-gui:latest | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
Submit_to_Microsoft_winget: | ||
|
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
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
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
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
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