Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added github workflows #7

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 🔨 Build Test

on:
pull_request:
paths:
- '**.go'
- '**.mod'
workflow_dispatch:

jobs:
build:
name: Test Builds
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-12]
go-version: [1.21.x]

steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: Check out code
uses: actions/checkout@v3

- name: Build
run: go build .
working-directory: .

- name: Test
run: go test ./...
working-directory: .
env:
PDCP_API_KEY: "${{ secrets.PDCP_API_KEY }}"

26 changes: 26 additions & 0 deletions .github/workflows/dep-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: 🤖 dep auto merge

on:
pull_request:
branches:
- dev
workflow_dispatch:

permissions:
pull-requests: write
issues: write
repository-projects: write

jobs:
automerge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.DEPENDABOT_PAT }}

- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
github-token: ${{ secrets.DEPENDABOT_PAT }}
target: all
40 changes: 40 additions & 0 deletions .github/workflows/dockerhub-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: 🌥 Docker Push

on:
workflow_run:
workflows: ["🎉 Release Binary"]
types:
- completed
workflow_dispatch:

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v3

- name: Get Github tag
id: meta
run: |
curl --silent "https://api.github.com/repos/projectdiscovery/tunnelx/releases/latest" | jq -r .tag_name | xargs -I {} echo TAG={} >> $GITHUB_OUTPUT

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

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

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm
push: true
tags: projectdiscovery/tunnelx:latest,projectdiscovery/tunnelx:${{ steps.meta.outputs.TAG }}
28 changes: 28 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 🙏🏻 Lint Test

on:
pull_request:
paths:
- '**.go'
- '**.mod'
workflow_dispatch:

jobs:
lint:
name: Lint Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: "Set up Go"
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: Run golangci-lint
uses: golangci/[email protected]
with:
version: latest
args: --timeout 5m
working-directory: .
32 changes: 32 additions & 0 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 🎉 Release Binary
on:
push:
tags:
- '*'
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: "Check out code"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: "Set up Go"
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: "Create release on GitHub"
uses: goreleaser/goreleaser-action@v6
with:
args: "release --clean"
version: latest
workdir: .
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
SLACK_WEBHOOK: "${{ secrets.RELEASE_SLACK_WEBHOOK }}"
DISCORD_WEBHOOK_ID: "${{ secrets.DISCORD_WEBHOOK_ID }}"
DISCORD_WEBHOOK_TOKEN: "${{ secrets.DISCORD_WEBHOOK_TOKEN }}"
30 changes: 30 additions & 0 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 🔨 Release Test

on:
pull_request:
paths:
- '**.go'
- '**.mod'
- '**.yml'
workflow_dispatch:

jobs:
release-test:
runs-on: ubuntu-latest-16-cores
steps:
- name: "Check out code"
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.21.x

- name: release test
uses: goreleaser/goreleaser-action@v6
with:
args: "release --clean --snapshot"
version: latest
workdir: .
Loading