Skip to content

Commit

Permalink
Merge pull request #24 from alash3al/v3
Browse files Browse the repository at this point in the history
V3
  • Loading branch information
alash3al authored Jun 5, 2024
2 parents 40d8774 + de03e9f commit fffc510
Show file tree
Hide file tree
Showing 33 changed files with 845 additions and 678 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/releaser.yaml
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/checkout@v4.1.3
- uses: wangyoucao577/go-release-action@v1.50
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/checkout@v4.1.3

- name: Get Latest Tag
id: var_tag
run: echo "name=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.3.0

- 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/build-push-action@v5.3.0
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
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/wsify.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 0 additions & 46 deletions CODE_OF_CONDUCT.md

This file was deleted.

6 changes: 0 additions & 6 deletions CONTRIBUTING.md

This file was deleted.

22 changes: 17 additions & 5 deletions Dockerfile
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
91 changes: 0 additions & 91 deletions Gopkg.lock

This file was deleted.

46 changes: 0 additions & 46 deletions Gopkg.toml

This file was deleted.

21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

30 changes: 0 additions & 30 deletions Makefile

This file was deleted.

Loading

0 comments on commit fffc510

Please sign in to comment.