|
| 1 | +name: Q Release Test |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + release_type: |
| 7 | + description: "Release type" |
| 8 | + required: true |
| 9 | + default: "release" |
| 10 | + type: choice |
| 11 | + options: |
| 12 | + - release |
| 13 | + - edge |
| 14 | + version_tag: |
| 15 | + description: "Version tag (e.g., v1.5.0)" |
| 16 | + required: true |
| 17 | + type: string |
| 18 | + |
| 19 | + pull_request: |
| 20 | + branches: |
| 21 | + - master |
| 22 | + |
| 23 | +concurrency: |
| 24 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 25 | + cancel-in-progress: true |
| 26 | + |
| 27 | +jobs: |
| 28 | + release-test: |
| 29 | + runs-on: ubuntu-latest |
| 30 | + steps: |
| 31 | + - name: Checkout |
| 32 | + uses: actions/checkout@v4 |
| 33 | + with: |
| 34 | + fetch-depth: 0 |
| 35 | + |
| 36 | + - name: Set up QEMU |
| 37 | + uses: docker/setup-qemu-action@v3 |
| 38 | + |
| 39 | + - name: Setup Go |
| 40 | + uses: actions/setup-go@v6 |
| 41 | + with: |
| 42 | + go-version-file: "go.mod" |
| 43 | + cache: false |
| 44 | + |
| 45 | + - name: Configure git |
| 46 | + run: | |
| 47 | + git config --global user.name "MinIO Bot" |
| 48 | + git config --global user.email "dev@min.io" |
| 49 | +
|
| 50 | + - name: Install Just |
| 51 | + uses: extractions/setup-just@v3 |
| 52 | + with: |
| 53 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 54 | + |
| 55 | + - name: Install Q Release Toolkit |
| 56 | + run: | |
| 57 | + curl -fsSL https://dl.min.io/download-info/qreleaser.tar.zst -o /tmp/qreleaser.tar.zst |
| 58 | + tar --zstd -xf /tmp/qreleaser.tar.zst -C /tmp/ |
| 59 | + echo y | just -f /tmp/qreleaser/Justfile install |
| 60 | + echo "$HOME/.local/bin" >> $GITHUB_PATH |
| 61 | + qreleaser setup-deps --install |
| 62 | +
|
| 63 | + - name: Determine release type and version |
| 64 | + id: release-type |
| 65 | + run: | |
| 66 | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then |
| 67 | + echo "type=${{ inputs.release_type }}" >> $GITHUB_OUTPUT |
| 68 | + echo "version=${{ inputs.version_tag }}" >> $GITHUB_OUTPUT |
| 69 | + else |
| 70 | + # For PRs, use a test version |
| 71 | + echo "type=release" >> $GITHUB_OUTPUT |
| 72 | + echo "version=v10.0.0" >> $GITHUB_OUTPUT |
| 73 | + fi |
| 74 | +
|
| 75 | + - name: Run Q Release (Test Mode) |
| 76 | + env: |
| 77 | + CI: "1" |
| 78 | + DEBUG: "1" |
| 79 | + Q_CI_SRC_DIR: ${{ github.workspace }} |
| 80 | + Q_VERSION_TAG: ${{ steps.release-type.outputs.version }} |
| 81 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 82 | + run: | |
| 83 | + qreleaser main ${{ github.repository }} ${{ steps.release-type.outputs.type }} |
| 84 | +
|
| 85 | + - name: Verify Release Artifacts |
| 86 | + run: | |
| 87 | + find ${{ github.workspace }}/warp-release -type f |
| 88 | + ${{ github.workspace }}/warp-release/${{ steps.release-type.outputs.type }}/linux-amd64/warp --version |
| 89 | +
|
| 90 | + - name: Upload Artifacts |
| 91 | + uses: actions/upload-artifact@v4 |
| 92 | + if: always() |
| 93 | + with: |
| 94 | + name: release-artifacts-${{ steps.release-type.outputs.type }} |
| 95 | + path: warp-release/ |
| 96 | + retention-days: 7 |
0 commit comments