feat(chart): add rustfs-resources chart for declaring CR instances fr… #7
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: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| image: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: docker/setup-buildx-action@v3 | |
| - uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=semver,pattern={{version}} | |
| type=semver,pattern={{major}}.{{minor}} | |
| - uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| github-release: | |
| runs-on: ubuntu-latest | |
| needs: image | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Binary artifact is opt-in: set the repository variable | |
| # RELEASE_BINARY=true to build and attach it. | |
| - uses: dtolnay/rust-toolchain@stable | |
| if: vars.RELEASE_BINARY == 'true' | |
| - uses: Swatinem/rust-cache@v2 | |
| if: vars.RELEASE_BINARY == 'true' | |
| - name: Build release binary | |
| if: vars.RELEASE_BINARY == 'true' | |
| run: | | |
| cargo build --release --bin rustfs-operator | |
| cp target/release/rustfs-operator rustfs-operator-linux-amd64 | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| # the glob matches nothing when the binary step is skipped | |
| files: | | |
| deploy/crds.yaml | |
| rustfs-operator-linux-amd64* | |
| charts: | |
| runs-on: ubuntu-latest | |
| needs: image | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set chart versions from tag | |
| run: | | |
| version="${GITHUB_REF_NAME#v}" | |
| for chart in charts/*/Chart.yaml; do | |
| sed -i "s/^version:.*/version: ${version}/" "$chart" | |
| sed -i "s/^appVersion:.*/appVersion: \"${version}\"/" "$chart" | |
| done | |
| - name: Configure git | |
| run: | | |
| git config user.name "$GITHUB_ACTOR" | |
| git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
| - name: Release chart to gh-pages | |
| uses: helm/chart-releaser-action@v1 | |
| with: | |
| charts_dir: charts | |
| mark_as_latest: false | |
| env: | |
| CR_TOKEN: ${{ secrets.GITHUB_TOKEN }} |