mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2025-10-26 02:00:30 +08:00
Chore: update actions
This commit is contained in:
22
.github/workflows/docker.yml
vendored
22
.github/workflows/docker.yml
vendored
@@ -3,12 +3,12 @@ name: Publish Docker Image
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- 'main'
|
||||
tags:
|
||||
- '*'
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- '**.md'
|
||||
- 'docs/**'
|
||||
|
||||
jobs:
|
||||
|
||||
@@ -45,21 +45,21 @@ jobs:
|
||||
username: xjasonlyu
|
||||
password: ${{ secrets.CR_PAT }}
|
||||
|
||||
- name: Build and Push (dev)
|
||||
if: github.ref == 'refs/heads/dev'
|
||||
- name: Get Version
|
||||
id: shell
|
||||
run: |
|
||||
echo ::set-output name=version::$(git describe --tags --abbrev=0)
|
||||
|
||||
- name: Build and Push (nightly)
|
||||
if: github.ref == 'refs/heads/main'
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm/v7,linux/arm64
|
||||
tags: |
|
||||
xjasonlyu/tun2socks:dev
|
||||
ghcr.io/xjasonlyu/tun2socks:dev
|
||||
|
||||
- name: Get Version
|
||||
id: shell
|
||||
run: |
|
||||
echo ::set-output name=version::$(git describe --tags --abbrev=0)
|
||||
xjasonlyu/tun2socks:nightly
|
||||
ghcr.io/xjasonlyu/tun2socks:nightly
|
||||
|
||||
- name: Build and Push (latest)
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
|
||||
36
.github/workflows/go.yml
vendored
36
.github/workflows/go.yml
vendored
@@ -1,32 +1,24 @@
|
||||
name: Go
|
||||
name: Go Static Check
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
tags:
|
||||
- '*'
|
||||
paths-ignore:
|
||||
- 'docs/**'
|
||||
- 'docker/**'
|
||||
- '**.md'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16.x
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16.x
|
||||
|
||||
- name: Cache go module
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
@@ -41,17 +33,3 @@ jobs:
|
||||
go vet ./...
|
||||
go install honnef.co/go/tools/cmd/staticcheck@latest
|
||||
staticcheck -- $(go list ./...)
|
||||
|
||||
- name: Build
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: make -j releases
|
||||
|
||||
- name: Upload Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
files: build/*
|
||||
draft: true
|
||||
prerelease: false
|
||||
|
||||
53
.github/workflows/release.yml
vendored
Normal file
53
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
name: Publish Go Releases
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
tags:
|
||||
- '*'
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
- 'docs/**'
|
||||
- 'docker/**'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: 1.16.x
|
||||
|
||||
- name: Build
|
||||
run: make -j releases
|
||||
|
||||
- name: Upload Releases (nightly)
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: github.ref == 'refs/heads/main'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
files: build/*
|
||||
draft: false
|
||||
prerelease: true
|
||||
name: Nightly Build
|
||||
tag_name: nightly
|
||||
body: Automatically Released by Actions.
|
||||
|
||||
- name: Upload Releases
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
files: build/*
|
||||
draft: true
|
||||
prerelease: false
|
||||
Reference in New Issue
Block a user