Browse Source

Chore: update workflows

pull/194/head
xjasonlyu 2 years ago
parent
commit
702ba81ccd
  1. 8
      .github/workflows/codeql-analysis.yml
  2. 4
      .github/workflows/docker.yml
  3. 10
      .github/workflows/linter.yml
  4. 10
      .github/workflows/release.yml

8
.github/workflows/codeql-analysis.yml

@ -16,15 +16,15 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v1 uses: github/codeql-action/init@v2
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@v1 uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1 uses: github/codeql-action/analyze@v2

4
.github/workflows/docker.yml

@ -57,6 +57,8 @@ jobs:
tags: | tags: |
xjasonlyu/tun2socks:dev xjasonlyu/tun2socks:dev
ghcr.io/xjasonlyu/tun2socks:dev ghcr.io/xjasonlyu/tun2socks:dev
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and Push (latest) - name: Build and Push (latest)
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
@ -70,3 +72,5 @@ jobs:
xjasonlyu/tun2socks:${{ steps.shell.outputs.version }} xjasonlyu/tun2socks:${{ steps.shell.outputs.version }}
ghcr.io/xjasonlyu/tun2socks:latest ghcr.io/xjasonlyu/tun2socks:latest
ghcr.io/xjasonlyu/tun2socks:${{ steps.shell.outputs.version }} ghcr.io/xjasonlyu/tun2socks:${{ steps.shell.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max

10
.github/workflows/linter.yml

@ -6,15 +6,11 @@ jobs:
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Get latest go version
id: version
run: |
echo ::set-output name=go_version::$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g')
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: ${{ steps.version.outputs.go_version }} check-latest: true
go-version: '1.19'
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@v3 uses: golangci/golangci-lint-action@v3

10
.github/workflows/release.yml

@ -15,15 +15,11 @@ jobs:
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Get latest Go version
id: version
run: |
echo ::set-output name=go_version::$(curl -s https://raw.githubusercontent.com/actions/go-versions/main/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g')
- name: Setup Go - name: Setup Go
uses: actions/setup-go@v2 uses: actions/setup-go@v3
with: with:
go-version: ${{ steps.version.outputs.go_version }} check-latest: true
go-version: '1.19'
- name: Cache go module - name: Cache go module
uses: actions/cache@v2 uses: actions/cache@v2

Loading…
Cancel
Save