Skip to content

Commit

Permalink
ci: fix getting friendly filename
Browse files Browse the repository at this point in the history
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
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 15 deletions.
62 changes: 48 additions & 14 deletions .github/workflows/release_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ FROM v2fly/v2fly-core
COPY --from=builder /build/service/v2raya /usr/bin/
RUN wget -O /usr/local/share/v2ray/LoyalsoldierSite.dat https://raw.githubusercontent.com/mzz2017/dist-v2ray-rules-dat/master/geosite.dat
RUN apk add --no-cache iptables ip6tables tzdata
LABEL org.opencontainers.image.source=https://github.com/v2rayA/v2rayA
EXPOSE 2017
VOLUME /etc/v2raya
ENTRYPOINT ["v2raya"]
1 change: 1 addition & 0 deletions Dockerfile.gui
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ RUN yarn && yarn build

FROM nginx:stable-alpine
COPY --from=builder /web /usr/share/nginx/html
LABEL org.opencontainers.image.source=https://github.com/v2rayA/v2rayA
EXPOSE 80
2 changes: 1 addition & 1 deletion install/windows-inno/v2rayA-service.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ SOFTWARE.
<description>A web GUI client of Project V which supports VMess, VLESS, SS, SSR, Trojan, Tuic and Juicity protocols.</description>
<executable>%BASE%\bin\v2raya.exe</executable>
<env name="PATH" value="%BASE%\bin\;%windir%\system32\"/>
<arguments>--lite --log-file "v2raya.log" --v2ray-assetsdir "%BASE%\data" --config "%BASE%"</arguments>
<arguments>--passcheckroot --log-file "v2raya.log" --v2ray-assetsdir "%BASE%\data" --config "%BASE%"</arguments>
<workingdirectory>%TEMP%</workingdirectory>
<log mode="roll"></log>
<onfailure action="restart" delay="10 sec"/>
Expand Down
1 change: 1 addition & 0 deletions install/windows-inno/windows_arm64.iss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ SolidCompression=yes
UninstallDisplayName={#MyAppName}-{#MyAppVersion}
WizardStyle=modern
SetupIconFile=D:\v2raya.ico
MinVersion=10.0.14393

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Expand Down
1 change: 1 addition & 0 deletions install/windows-inno/windows_x86_64.iss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ SolidCompression=yes
UninstallDisplayName={#MyAppName}-{#MyAppVersion}
WizardStyle=modern
SetupIconFile=D:\v2raya.ico
MinVersion=10.0.14393

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Expand Down

0 comments on commit 2d2c3a5

Please sign in to comment.