Release 1.0.1 #29
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: Release | |
| run-name: Release ${{ inputs.tag }} | |
| permissions: | |
| contents: read | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag to be released (e.g., 1.0.0)" | |
| required: true | |
| all_platforms: | |
| description: "Build Docker for all platforms (linux/amd64,linux/arm64) or just linux/amd64" | |
| required: false | |
| type: boolean | |
| default: true | |
| jobs: | |
| # Always publish documentation for every release | |
| publish-versioned-docs: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| environment: | |
| name: github-pages | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.x | |
| cache: pip | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Ensure mike is installed | |
| run: mike --version | |
| - name: Configure git for Mike | |
| run: | | |
| git config user.name "${{ github.actor }}" | |
| git config user.email "${{ github.actor }}@users.noreply.github.com" | |
| - name: Extract major.minor version | |
| id: version | |
| run: | | |
| # Extract major.minor from tag (e.g., 1.0.0 -> 1.0, 1.1.1 -> 1.1) | |
| # This ensures the dropdown shows "1.1" not "1.1.1" | |
| VERSION=$(echo "${{ inputs.tag }}" | sed -E 's/^([0-9]+\.[0-9]+).*$/\1/') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Publishing documentation for version: $VERSION (from tag: ${{ inputs.tag }})" | |
| echo "MkDocs dropdown will show: $VERSION" | |
| - name: Deploy versioned documentation with Mike | |
| run: | | |
| # Fetch the gh-pages branch | |
| git fetch origin gh-pages:gh-pages || true | |
| # Deploy the new version using major.minor as alias | |
| # The version identifier and title both use major.minor format (e.g., "1.1") | |
| # This ensures URLs like /1.1/ and dropdown shows "1.1" not "1.1.1" | |
| # The major.minor alias acts as "latest" for that version series (e.g., 1.0.1 becomes latest for 1.0.x) | |
| echo "Deploying version ${{ steps.version.outputs.version }} with alias ${{ steps.version.outputs.version }}" | |
| # Check if version already exists to avoid duplicate error | |
| if mike list --branch=gh-pages | grep -q "^${{ steps.version.outputs.version }}"; then | |
| echo "Version ${{ steps.version.outputs.version }} already exists, updating it" | |
| mike deploy ${{ steps.version.outputs.version }} --title="${{ steps.version.outputs.version }}" --update-aliases --push | |
| else | |
| echo "Creating new version ${{ steps.version.outputs.version }}" | |
| mike deploy ${{ steps.version.outputs.version }} ${{ steps.version.outputs.version }} --title="${{ steps.version.outputs.version }}" --update-aliases --push | |
| fi | |
| - name: List deployed versions | |
| run: mike list --branch=gh-pages | |
| prod-container-with-docker: | |
| needs: [publish-versioned-docs] | |
| permissions: | |
| contents: read | |
| packages: write | |
| uses: scality/workflows/.github/workflows/docker-build.yaml@v2 | |
| with: | |
| context: . | |
| name: mountpoint-s3-csi-driver | |
| namespace: ${{ github.repository_owner }} | |
| tag: ${{ inputs.tag }} | |
| platforms: ${{ inputs.all_platforms && 'linux/amd64,linux/arm64' || 'linux/amd64' }} | |
| package-helm-chart: | |
| needs: [publish-versioned-docs] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4.3.0 | |
| with: | |
| version: v3.16.2 | |
| - name: login to ghcr.io with helm | |
| run: helm registry login -u actions -p ${{ github.token }} ghcr.io | |
| - name: Package Helm Chart | |
| run: | | |
| helm package ./charts/scality-mountpoint-s3-csi-driver --version ${{ inputs.tag }} --app-version ${{ inputs.tag }} | |
| - name: Upload Helm Chart as Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: helm-chart | |
| path: scality-mountpoint-s3-csi-driver-${{ inputs.tag }}.tgz | |
| - name: Push helm chart to ghcr.io | |
| run: helm push scality-mountpoint-s3-csi-driver-${{ inputs.tag }}.tgz oci://ghcr.io/${{ github.repository }}/helm-charts | |
| - name: Pull the helm chart | |
| run: helm pull oci://ghcr.io/${{ github.repository }}/helm-charts/scality-mountpoint-s3-csi-driver --version ${{ inputs.tag }} | |
| - name: Show the helm chart | |
| run: helm show all oci://ghcr.io/${{ github.repository }}/helm-charts/scality-mountpoint-s3-csi-driver --version ${{ inputs.tag }} | |
| - name: Template the helm chart | |
| run: helm template oci://ghcr.io/${{ github.repository }}/helm-charts/scality-mountpoint-s3-csi-driver --version ${{ inputs.tag }} | |
| create-github-release: | |
| runs-on: ubuntu-latest | |
| needs: [prod-container-with-docker, package-helm-chart] | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| target_commitish: ${{ github.sha }} | |
| tag_name: ${{ inputs.tag }} | |
| name: Release ${{ inputs.tag }} | |
| generate_release_notes: true | |
| body: | | |
| ## Scality CSI Driver for S3 | |
| **Documentation**: https://scality.github.io/mountpoint-s3-csi-driver/ |