diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index bb10733..1f90f7b 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -23,28 +23,10 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Get latest go version - id: version - run: | - echo 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') >> $GITHUB_OUTPUT - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: ${{ steps.version.outputs.go_version }} - - name: Cache go module - uses: actions/cache@v3 - with: - path: | - ~/go/pkg/mod - key: go-${{ hashFiles('**/go.sum') }} - - name: Add cache to Go proxy - run: | - version=`git rev-parse HEAD` - mkdir build - pushd build - go mod init build - go get -v github.com/sagernet/serenity@$version - popd + go-version: ^1.22 continue-on-error: true - name: Run Test run: | diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index e7c94f2..bb91fd8 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,9 +1,10 @@ name: Build Docker Images + on: - workflow_dispatch: - inputs: - tag: - description: "The tag version you want to build" + release: + types: + - released + jobs: build: runs-on: ubuntu-latest @@ -25,15 +26,6 @@ jobs: uses: docker/metadata-action@v5 with: images: ghcr.io/sagernet/serenity - - name: Get tag to build - id: tag - run: | - echo "latest=ghcr.io/sagernet/serenity:latest" >> $GITHUB_OUTPUT - if [[ -z "${{ github.event.inputs.tag }}" ]]; then - echo "versioned=ghcr.io/sagernet/serenity:${{ github.ref_name }}" >> $GITHUB_OUTPUT - else - echo "versioned=ghcr.io/sagernet/serenity:${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT - fi - name: Build and release Docker images uses: docker/build-push-action@v5 with: @@ -42,6 +34,6 @@ jobs: build-args: | BUILDKIT_CONTEXT_KEEP_GIT_DIR=1 tags: | - ${{ steps.tag.outputs.latest }} - ${{ steps.tag.outputs.versioned }} + ghcr.io/sagernet/serenity:latest + ghcr.io/sagernet/serenity:${{ github.ref_name }} push: true diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 961b8a2..c1547d5 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -23,16 +23,12 @@ jobs: uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 with: fetch-depth: 0 - - name: Get latest go version - id: version - run: | - echo 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') >> $GITHUB_OUTPUT - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: ${{ steps.version.outputs.go_version }} + go-version: ^1.22 - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v4 with: version: latest args: --timeout=30m