|
| 1 | +name: Build Beta Version |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - 'beta' |
| 7 | + workflow_dispatch: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build-and-package-beta: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout repository |
| 14 | + uses: actions/checkout@v4 |
| 15 | + |
| 16 | + - name: Set up Go |
| 17 | + uses: actions/setup-go@v5 |
| 18 | + with: |
| 19 | + go-version: '1.22.x' |
| 20 | + cache-dependency-path: core/scripts/auth/go.sum |
| 21 | + |
| 22 | + - name: Generate beta version string |
| 23 | + id: get_version |
| 24 | + run: echo "version=beta-$(date +'%Y%m%d')-$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT |
| 25 | + |
| 26 | + - name: Initialize Go module |
| 27 | + working-directory: ./core/scripts/auth |
| 28 | + run: | |
| 29 | + go mod init hysteria_auth |
| 30 | + go mod tidy |
| 31 | +
|
| 32 | + - name: Build and Package for linux-amd64 |
| 33 | + id: package_amd64 |
| 34 | + run: | |
| 35 | + (cd core/scripts/auth && GOOS=linux GOARCH=amd64 go build -o user_auth .) |
| 36 | + zip_name="Blitz-${{ steps.get_version.outputs.version }}-amd64.zip" |
| 37 | + zip -r "$zip_name" . \ |
| 38 | + -x ".git/*" \ |
| 39 | + ".github/*" \ |
| 40 | + "*.zip" \ |
| 41 | + ".gitignore" \ |
| 42 | + "CONTRIBUTING.md" \ |
| 43 | + "LICENSE" \ |
| 44 | + "README*.md" \ |
| 45 | + "SECURITY.md" \ |
| 46 | + "changelog" \ |
| 47 | + "core/scripts/auth/go.*" \ |
| 48 | + "core/scripts/auth/user_auth.go" |
| 49 | + rm core/scripts/auth/user_auth |
| 50 | + echo "zip_name=$zip_name" >> $GITHUB_OUTPUT |
| 51 | +
|
| 52 | + - name: Build and Package for linux-arm64 |
| 53 | + id: package_arm64 |
| 54 | + run: | |
| 55 | + (cd core/scripts/auth && GOOS=linux GOARCH=arm64 go build -o user_auth .) |
| 56 | + zip_name="Blitz-${{ steps.get_version.outputs.version }}-arm64.zip" |
| 57 | + zip -r "$zip_name" . \ |
| 58 | + -x ".git/*" \ |
| 59 | + ".github/*" \ |
| 60 | + "*.zip" \ |
| 61 | + ".gitignore" \ |
| 62 | + "CONTRIBUTING.md" \ |
| 63 | + "LICENSE" \ |
| 64 | + "README*.md" \ |
| 65 | + "SECURITY.md" \ |
| 66 | + "changelog" \ |
| 67 | + "core/scripts/auth/go.*" \ |
| 68 | + "core/scripts/auth/user_auth.go" |
| 69 | + rm core/scripts/auth/user_auth |
| 70 | + echo "zip_name=$zip_name" >> $GITHUB_OUTPUT |
| 71 | +
|
| 72 | + - name: Upload Beta Artifacts |
| 73 | + uses: actions/upload-artifact@v4 |
| 74 | + with: |
| 75 | + name: Blitz-Beta-Builds |
| 76 | + path: | |
| 77 | + ${{ steps.package_amd64.outputs.zip_name }} |
| 78 | + ${{ steps.package_arm64.outputs.zip_name }} |
0 commit comments