|
| 1 | +# release-workflow.yaml |
| 2 | +# Copyright (c) 2024 Dell Inc., or its subsidiaries. All Rights Reserved. |
| 3 | +# Licensed under the Apache License, Version 2.0 |
| 4 | + |
| 5 | +name: Create Tag and Release |
| 6 | + |
| 7 | +on: |
| 8 | + workflow_call: |
| 9 | + inputs: |
| 10 | + version: |
| 11 | + description: "Semantic version to release. Ex: major, minor, or patch" |
| 12 | + type: string |
| 13 | + required: true |
| 14 | + images: |
| 15 | + description: "List of image names. Example: csi-powerstore,csi-isilon" |
| 16 | + type: string |
| 17 | + required: true |
| 18 | + |
| 19 | +jobs: |
| 20 | + build-and-scan: |
| 21 | + name: Build and Scan |
| 22 | + runs-on: ubuntu-latest |
| 23 | + steps: |
| 24 | + - name: Checkout the code |
| 25 | + uses: actions/checkout@v4 |
| 26 | + with: |
| 27 | + fetch-depth: 0 |
| 28 | + - name: Set up Go |
| 29 | + uses: actions/setup-go@v5 |
| 30 | + with: |
| 31 | + go-version: "1.24" |
| 32 | + - name: Install dependencies |
| 33 | + run: go mod tidy |
| 34 | + - name: Build binaries |
| 35 | + run: | |
| 36 | + echo "Building binaries to attach to the release if any..." |
| 37 | + if "${{ inputs.images == 'cert-csi' }}"; then |
| 38 | + make build |
| 39 | + mv cert-csi cert-csi-linux-amd64 |
| 40 | + echo "BIN_NAME=cert-csi-linux-amd64" >> $GITHUB_ENV |
| 41 | + fi |
| 42 | + if "${{ contains(inputs.images, 'dell-csi-replicator') || contains(inputs.images, 'dell-replication-controller') }}"; then |
| 43 | + cd repctl |
| 44 | + make build |
| 45 | + mv repctl repctl-linux-amd64 |
| 46 | + mv repctl-linux-amd64 ../ |
| 47 | + echo "BIN_NAME=repctl-linux-amd64" >> $GITHUB_ENV |
| 48 | + fi |
| 49 | + - name: Upload Binaries |
| 50 | + if: ${{ env.BIN_NAME != '' }} |
| 51 | + |
| 52 | + env: |
| 53 | + BIN_NAME: ${{ env.BIN_NAME }} |
| 54 | + with: |
| 55 | + name: ${{ env.BIN_NAME }} |
| 56 | + path: ${{ env.BIN_NAME }} |
| 57 | + |
| 58 | + release-and-tag: |
| 59 | + name: Tag and Release |
| 60 | + needs: build-and-scan |
| 61 | + uses: KshitijaKakde/common-github-actions/.github/workflows/release-creator.yaml@main |
| 62 | + with: |
| 63 | + version: ${{ inputs.version }} |
| 64 | + secrets: inherit |
0 commit comments