-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #84 from tailscale/update-go1.22.0
Update go1.22.0
- Loading branch information
Showing
14 changed files
with
392 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
name: Build toolchain | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
branches: | ||
- tailscale | ||
- 'tailscale.go1.21' | ||
pull_request: | ||
branches: | ||
- '*' | ||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: Branch, commit or tag to build from | ||
required: true | ||
default: 'tailscale.go1.21' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.ref || github.ref }} | ||
- name: test | ||
run: cd src && ./all.bash | ||
|
||
build_release: | ||
strategy: | ||
matrix: | ||
GOOS: ["linux", "darwin"] | ||
GOARCH: ["amd64", "arm64"] | ||
runs-on: ubuntu-20.04 | ||
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.ref || github.ref }} | ||
- name: build | ||
run: cd src && ./make.bash | ||
env: | ||
GOOS: "${{ matrix.GOOS }}" | ||
GOARCH: "${{ matrix.GOARCH }}" | ||
CGO_ENABLED: "0" | ||
- name: trim unnecessary bits | ||
run: | | ||
rm -rf pkg/*_* | ||
mv pkg/tool/${{ matrix.GOOS }}_${{ matrix.GOARCH }} pkg | ||
rm -rf pkg/tool/*_* | ||
mv -f bin/${{ matrix.GOOS }}_${{ matrix.GOARCH }}/* bin/ || true | ||
rm -rf bin/${{ matrix.GOOS }}_${{ matrix.GOARCH }} | ||
mv pkg/${{ matrix.GOOS }}_${{ matrix.GOARCH }} pkg/tool | ||
find . -type d -name 'testdata' -print0 | xargs -0 rm -rf | ||
find . -name '*_test.go' -delete | ||
- name: archive | ||
run: cd .. && tar --exclude-vcs -zcf ${{ matrix.GOOS }}-${{ matrix.GOARCH }}.tar.gz go | ||
- name: save | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: ${{ matrix.GOOS }}-${{ matrix.GOARCH }} | ||
path: ../${{ matrix.GOOS }}-${{ matrix.GOARCH }}.tar.gz | ||
|
||
create_release: | ||
runs-on: ubuntu-20.04 | ||
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) | ||
needs: [test, build_release] | ||
outputs: | ||
url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- name: create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
# Release name can't be the same as tag name, sigh | ||
tag_name: build-${{ inputs.ref || github.sha }} | ||
release_name: ${{ inputs.ref || github.sha }} | ||
draft: false | ||
prerelease: true | ||
|
||
upload_release: | ||
strategy: | ||
matrix: | ||
GOOS: ["linux", "darwin"] | ||
GOARCH: ["amd64", "arm64"] | ||
runs-on: ubuntu-20.04 | ||
if: contains(fromJSON('["push", "workflow_dispatch"]'), github.event_name) | ||
needs: [create_release] | ||
steps: | ||
- name: download artifact | ||
uses: actions/download-artifact@v1 | ||
with: | ||
name: ${{ matrix.GOOS }}-${{ matrix.GOARCH }} | ||
- name: upload artifact | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.create_release.outputs.url }} | ||
asset_path: ${{ matrix.GOOS }}-${{ matrix.GOARCH }}/${{ matrix.GOOS }}-${{ matrix.GOARCH }}.tar.gz | ||
asset_name: ${{ matrix.GOOS }}-${{ matrix.GOARCH }}.tar.gz | ||
asset_content_type: application/gzip | ||
|
||
clean_old: | ||
runs-on: ubuntu-20.04 | ||
# Do not clean up old builds on workflow_dispatch to allow temporarily | ||
# re-creating old releases for backports. | ||
if: github.event_name == 'push' | ||
needs: [upload_release] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ inputs.ref || github.ref }} | ||
- name: Delete older builds | ||
run: ./.github/workflows/prune_old_builds.sh "${{ secrets.GITHUB_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
KEEP=10 | ||
GITHUB_TOKEN=$1 | ||
|
||
delete_release() { | ||
release_id=$1 | ||
tag_name=$2 | ||
set -x | ||
curl -X DELETE --header "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/tailscale/go/releases/$release_id" | ||
curl -X DELETE --header "Authorization: Bearer $GITHUB_TOKEN" "https://api.github.com/repos/tailscale/go/git/refs/tags/$tag_name" | ||
set +x | ||
} | ||
|
||
curl https://api.github.com/repos/tailscale/go/releases 2>/dev/null |\ | ||
jq -r '.[] | "\(.published_at) \(.id) \(.tag_name)"' |\ | ||
egrep '[^ ]+ [^ ]+ build-[0-9a-f]{40}' |\ | ||
sort |\ | ||
head --lines=-${KEEP}|\ | ||
while read date release_id tag_name; do | ||
delete_release "$release_id" "$tag_name" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
pkg net, func SetDialEnforcer(func(context.Context, []Addr) error) #55 | ||
pkg net, func SetResolveEnforcer(func(context.Context, string, string, string, Addr) error) #55 | ||
pkg net/http, func SetRoundTripEnforcer(func(*Request) error) #55 | ||
pkg net, func WithSockTrace(context.Context, *SockTrace) context.Context #58 | ||
pkg net, func ContextSockTrace(context.Context) *SockTrace #58 | ||
pkg net, type SockTrace struct #58 | ||
pkg net, type SockTrace struct, DidRead func(int) #58 | ||
pkg net, type SockTrace struct, DidWrite func(int) #58 | ||
pkg net, type SockTrace struct, WillOverwrite func(*SockTrace) #58 | ||
pkg net, type SockTrace struct, DidCreateTCPConn func(syscall.RawConn) #58 | ||
pkg net, type SockTrace struct, WillCloseTCPConn func(syscall.RawConn) #58 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.