v11.0.0-beta.2 #5
Workflow file for this run
This file contains hidden or 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
| name: Installer Release V11 | |
| on: | |
| release: | |
| types: ['released', 'prereleased'] | |
| jobs: | |
| setup_deployment: | |
| name: Setup Deployment | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| environment: ${{ steps.set-env.outputs.environment }} | |
| version: ${{ steps.set-env.outputs.version }} | |
| steps: | |
| - name: Validate and Determine Build Environment | |
| id: set-env | |
| run: | | |
| VERSION="${{ github.event.release.tag_name }}" | |
| # Verify tag starts with v11. | |
| if [[ ! "$VERSION" =~ ^v11\. ]]; then | |
| echo "Skipping: This workflow only processes v11.* releases" | |
| echo "Received tag: $VERSION" | |
| exit 0 | |
| fi | |
| # Validate version format and determine environment | |
| if [[ "$VERSION" =~ ^v11\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "Production environment detected" | |
| echo "environment=prod" >> $GITHUB_OUTPUT | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| elif [[ "$VERSION" =~ ^v11\.[0-9]+\.[0-9]+-beta\.[0-9]+$ ]]; then | |
| echo "Beta environment detected" | |
| echo "environment=beta" >> $GITHUB_OUTPUT | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| elif [[ "$VERSION" =~ ^v11\.[0-9]+\.[0-9]+-rc\.[0-9]+$ ]]; then | |
| echo "RC environment detected" | |
| echo "environment=rc" >> $GITHUB_OUTPUT | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| else | |
| echo "ERROR: Invalid version format. Version must match one of:" | |
| echo " - v11.x.x (production)" | |
| echo " - v11.x.x-beta.x (beta)" | |
| echo " - v11.x.x-rc.x (release candidate)" | |
| exit 1 | |
| fi | |
| build: | |
| name: Build | |
| runs-on: ubuntu-24.04 | |
| needs: setup_deployment | |
| if: needs.setup_deployment.outputs.environment != '' | |
| steps: | |
| - name: Check out code into the right branch | |
| uses: actions/checkout@v4 | |
| - name: Set up Go 1.x | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: ^1.20 | |
| id: go | |
| - name: Configure git for private modules | |
| run: | | |
| git config --global url."https://${{ secrets.API_SECRET }}:[email protected]/".insteadOf "https://github.com/" | |
| echo "GOPRIVATE=github.com/utmstack" >> $GITHUB_ENV | |
| echo "GONOPROXY=github.com/utmstack" >> $GITHUB_ENV | |
| echo "GONOSUMDB=github.com/utmstack" >> $GITHUB_ENV | |
| - name: Build | |
| working-directory: ./installer | |
| env: | |
| GOOS: linux | |
| GOARCH: amd64 | |
| GOPRIVATE: github.com/utmstack | |
| GONOPROXY: github.com/utmstack | |
| GONOSUMDB: github.com/utmstack | |
| run: | | |
| echo "Building Installer..." | |
| go build -o installer -v -ldflags "\ | |
| -X 'github.com/utmstack/UTMStack/installer/config.DEFAULT_BRANCH=${{ needs.setup_deployment.outputs.environment }}' \ | |
| -X 'github.com/utmstack/UTMStack/installer/config.INSTALLER_VERSION=${{ needs.setup_deployment.outputs.version }}' \ | |
| -X 'github.com/utmstack/UTMStack/installer/config.REPLACE=${{ secrets.CM_ENCRYPT_SALT }}' \ | |
| -X 'github.com/utmstack/UTMStack/installer/config.PUBLIC_KEY=${{ secrets.CM_SIGN_PUBLIC_KEY }}'" . | |
| - name: Upload Release Assets | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| body_path: ./CHANGELOG.md | |
| draft: false | |
| files: | | |
| ./installer/installer |