-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from alash3al/v3
V3
- Loading branch information
Showing
33 changed files
with
845 additions
and
678 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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
env: | ||
CGO_ENABLED: "0" | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: alash3al/wsify | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
binary-releaser: | ||
name: Release Go Binary | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
goos: [linux, darwin] | ||
goarch: [amd64, arm64] | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: wangyoucao577/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
goos: ${{ matrix.goos }} | ||
goarch: ${{ matrix.goarch }} | ||
goversion: "https://dl.google.com/go/go1.22.0.linux-amd64.tar.gz" | ||
project_path: "." | ||
binary_name: "wsify" | ||
ldflags: "-s -w" | ||
|
||
docker-releaser: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
|
||
- name: Get Latest Tag | ||
id: var_tag | ||
run: echo "name=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
|
||
- name: Log in to Github Container registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/[email protected] | ||
with: | ||
file: Dockerfile | ||
context: . | ||
push: true | ||
tags: | | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.var_tag.outputs.name }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,9 +1,21 @@ | ||
FROM golang:alpine | ||
FROM golang:1.22-alpine As builder | ||
|
||
RUN apk update && apk add git | ||
WORKDIR /wsify/ | ||
|
||
RUN go install github.com/alash3al/wsify@latest | ||
RUN apk update && apk add git upx | ||
|
||
ENTRYPOINT ["wsify"] | ||
COPY go.mod go.sum ./ | ||
|
||
WORKDIR /root/ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o /usr/bin/wsify . | ||
|
||
RUN upx -9 /usr/bin/wsify | ||
|
||
FROM alpine | ||
|
||
WORKDIR /wsify/ | ||
|
||
COPY --from=builder /usr/bin/wsify /usr/bin/wsify |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.