release: prepare version v1.0.3 (#146) #41
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
| # Copyright AGNTCY Contributors (https://github.com/agntcy) | |
| # SPDX-License-Identifier: Apache-2.0 | |
| name: Release pipeline | |
| on: | |
| push: | |
| tags: | |
| - "v*.*.*" | |
| jobs: | |
| sdk-binaries: | |
| name: Build SDK binaries | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Taskfile | |
| shell: bash | |
| run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin | |
| - name: Build | |
| run: | | |
| task compile:all | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4.4.3 | |
| with: | |
| name: binaries | |
| path: bin | |
| if-no-files-found: error | |
| docker-image: | |
| name: Build & Push Docker Images | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker images | |
| uses: docker/bake-action@v6 | |
| with: | |
| files: docker-bake.hcl | |
| provenance: false | |
| push: true | |
| set: | | |
| oasf-sdk.tags=ghcr.io/${{ github.repository_owner }}/oasf-sdk:${{ github.ref_name }} | |
| oasf-sdk.tags=ghcr.io/${{ github.repository_owner }}/oasf-sdk:latest | |
| helm-chart: | |
| name: Build & Push Helm Chart | |
| runs-on: ubuntu-latest | |
| permissions: | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Taskfile | |
| shell: bash | |
| run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Lint Helm chart | |
| run: task helm:lint | |
| - name: Package Helm chart | |
| run: task helm:package VERSION="${{ github.ref_name }}" | |
| - name: Push Helm chart to GHCR | |
| run: task helm:push VERSION="${{ github.ref_name }}" | |
| release: | |
| name: Release | |
| needs: | |
| - sdk-binaries | |
| - docker-image | |
| - helm-chart | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: binaries | |
| path: bin | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: bin/** | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| find-modules: | |
| name: Find modules | |
| runs-on: ubuntu-latest | |
| outputs: | |
| modules: ${{ steps.modules.outputs.modules }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Get modules | |
| id: modules | |
| run: | | |
| # shellcheck disable=SC2016 | |
| echo "modules=$(find . -name go.mod -type f -print0 | xargs -0 awk '/module/ {print $2}' | jq -c -R '[.,inputs] | map(sub("^github.com\/agntcy\/oasf-sdk\/";""))')" >> "$GITHUB_OUTPUT" | |
| create-module-tags: | |
| name: Create module tags | |
| needs: find-modules | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| strategy: | |
| matrix: | |
| tags: ${{ fromJson(needs.find-modules.outputs.modules) }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Create tags | |
| uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 | |
| with: | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| script: | | |
| github.rest.git.createRef({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| ref: 'refs/tags/${{ matrix.tags }}/${{ github.ref_name }}', | |
| sha: context.sha | |
| }) |