|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + workflow_dispatch: |
| 8 | + inputs: |
| 9 | + tag: |
| 10 | + description: "Tag to release (e.g. v1.2.3). Required when dispatched from a branch." |
| 11 | + required: false |
| 12 | + type: string |
| 13 | + |
| 14 | +jobs: |
| 15 | + binary: |
| 16 | + name: Release Binary |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v3 |
| 20 | + with: |
| 21 | + fetch-depth: 0 |
| 22 | + ref: ${{ github.event.inputs.tag || github.ref }} |
| 23 | + |
| 24 | + - uses: actions/setup-go@v3 |
| 25 | + with: |
| 26 | + go-version-file: go.mod |
| 27 | + |
| 28 | + - uses: docker/login-action@v2 |
| 29 | + with: |
| 30 | + username: ${{ secrets.DOCKERHUB_USERNAME }} |
| 31 | + password: ${{ secrets.DOCKERHUB_TOKEN }} |
| 32 | + |
| 33 | + - uses: goreleaser/goreleaser-action@v4 |
| 34 | + with: |
| 35 | + args: "release --clean" |
| 36 | + version: latest |
| 37 | + env: |
| 38 | + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
| 39 | + GORELEASER_CURRENT_TAG: ${{ github.event.inputs.tag }} |
| 40 | + |
| 41 | + action: |
| 42 | + name: Release Action |
| 43 | + runs-on: ubuntu-latest |
| 44 | + needs: binary |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + with: |
| 48 | + ref: ${{ github.event.inputs.tag || github.ref }} |
| 49 | + - uses: softprops/action-gh-release@v2 |
| 50 | + with: |
| 51 | + fail_on_unmatched_files: true |
| 52 | + tag_name: ${{ github.event.inputs.tag }} |
| 53 | + files: | |
| 54 | + action.yml |
| 55 | + version.txt |
| 56 | +
|
| 57 | + helm: |
| 58 | + name: Deploy Helm Charts to GitHub Pages |
| 59 | + runs-on: ubuntu-latest |
| 60 | + needs: binary |
| 61 | + steps: |
| 62 | + - name: Checkout repository |
| 63 | + uses: actions/checkout@v3 |
| 64 | + with: |
| 65 | + ref: ${{ github.event.inputs.tag || github.ref }} |
| 66 | + |
| 67 | + - name: Set up Helm |
| 68 | + uses: azure/setup-helm@v3 |
| 69 | + with: |
| 70 | + version: v3.13.0 |
| 71 | + |
| 72 | + - name: Package Helm Chart |
| 73 | + run: | |
| 74 | + mkdir -p packaged |
| 75 | + helm package helm --destination packaged |
| 76 | + cd packaged |
| 77 | + helm repo index . --url https://escape-technologies.github.io/cli/ |
| 78 | +
|
| 79 | + - name: Deploy to GitHub Pages |
| 80 | + uses: peaceiris/actions-gh-pages@v3 |
| 81 | + with: |
| 82 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 83 | + publish_dir: packaged |
| 84 | + publish_branch: gh-pages |
0 commit comments