|
1 | | -# name: Release |
| 1 | +name: Release |
2 | 2 |
|
3 | | -# CHANGE IMAGE_NAME |
4 | | -# SET YC_REGISTRY, YC_KEY_JSON |
5 | | - |
6 | | -# on: |
7 | | -# workflow_run: |
8 | | -# workflows: ["CI"] |
9 | | -# types: [completed] |
10 | | -# branches: ["main"] |
| 3 | +on: |
| 4 | + workflow_run: |
| 5 | + workflows: ["CI"] |
| 6 | + types: [completed] |
| 7 | + branches: ["main"] |
11 | 8 |
|
12 | | -# concurrency: |
13 | | -# group: ${{ github.workflow }}-${{ github.ref }} |
14 | | -# cancel-in-progress: true |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 11 | + cancel-in-progress: true |
15 | 12 |
|
16 | | -# env: |
17 | | -# REGISTRY: cr.yandex |
18 | | -# IMAGE_NAME: |
| 13 | +# CHANGE IMAGE_NAME |
| 14 | +# SET YC_REGISTRY, YC_KEY_JSON |
| 15 | +env: |
| 16 | + REGISTRY: cr.yandex |
| 17 | + # IMAGE_NAME: image-name |
19 | 18 |
|
20 | | -# jobs: |
21 | | -# release: |
22 | | -# name: Release |
23 | | -# runs-on: ubuntu-latest |
24 | | -# if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }} |
25 | | -# permissions: |
26 | | -# contents: write |
27 | | -# outputs: |
28 | | -# skipped: ${{ steps.changelog.outputs.skipped }} |
29 | | -# tag: ${{ steps.changelog.outputs.tag }} |
30 | | -# steps: |
31 | | -# - uses: actions/checkout@v4 |
32 | | -# with: |
33 | | -# fetch-depth: 0 |
34 | | -# - name: Generate changelog & version |
35 | | -# id: changelog |
36 | | -# uses: TriPSs/conventional-changelog-action@v6 |
37 | | -# with: |
38 | | -# github-token: ${{ secrets.github_token }} |
39 | | -# git-user-name: "github-actions[bot]" |
40 | | -# git-user-email: "41898282+github-actions[bot]@users.noreply.github.com" |
41 | | -# version-file: "./version.json" |
42 | | -# version-path: "version" |
43 | | -# preset: "conventionalcommits" |
44 | | -# tag-prefix: "v" |
45 | | -# output-file: "false" |
| 19 | +jobs: |
| 20 | + release: |
| 21 | + name: Release |
| 22 | + runs-on: ubuntu-latest |
| 23 | + if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main' }} |
| 24 | + permissions: |
| 25 | + contents: write |
| 26 | + outputs: |
| 27 | + skipped: ${{ steps.changelog.outputs.skipped }} |
| 28 | + tag: ${{ steps.changelog.outputs.tag }} |
| 29 | + steps: |
| 30 | + - uses: actions/checkout@v4 |
| 31 | + with: |
| 32 | + fetch-depth: 0 |
| 33 | + - name: Generate changelog & version |
| 34 | + id: changelog |
| 35 | + uses: TriPSs/conventional-changelog-action@v6 |
| 36 | + with: |
| 37 | + github-token: ${{ secrets.github_token }} |
| 38 | + git-user-name: "github-actions[bot]" |
| 39 | + git-user-email: "41898282+github-actions[bot]@users.noreply.github.com" |
| 40 | + version-file: "./version.json" |
| 41 | + version-path: "version" |
| 42 | + preset: "conventionalcommits" |
| 43 | + tag-prefix: "v" |
| 44 | + output-file: "false" |
46 | 45 |
|
47 | | -# - name: Create Release |
48 | | -# if: ${{ steps.changelog.outputs.skipped == 'false' }} |
49 | | -# uses: softprops/action-gh-release@v2 |
50 | | -# with: |
51 | | -# tag_name: ${{ steps.changelog.outputs.tag }} |
52 | | -# name: ${{ steps.changelog.outputs.tag }} |
53 | | -# body: ${{ steps.changelog.outputs.clean_changelog }} |
| 46 | + - name: Create Release |
| 47 | + if: ${{ steps.changelog.outputs.skipped == 'false' }} |
| 48 | + uses: softprops/action-gh-release@v2 |
| 49 | + with: |
| 50 | + tag_name: ${{ steps.changelog.outputs.tag }} |
| 51 | + name: ${{ steps.changelog.outputs.tag }} |
| 52 | + body: ${{ steps.changelog.outputs.clean_changelog }} |
54 | 53 |
|
55 | | -# docker: |
56 | | -# name: Build & Push |
57 | | -# runs-on: ubuntu-latest |
58 | | -# needs: release |
59 | | -# if: ${{ needs.release.outputs.skipped == 'false' }} |
60 | | -# steps: |
61 | | -# - uses: actions/checkout@v4 |
62 | | -# - name: Extract version |
63 | | -# id: version |
64 | | -# run: | |
65 | | -# echo "version=${TAG#v}" >> $GITHUB_OUTPUT |
66 | | -# env: |
67 | | -# TAG: ${{ needs.release.outputs.tag }} |
68 | | -# - name: Login to Yandex CR |
69 | | -# uses: yc-actions/yc-cr-login@v3 |
70 | | -# with: |
71 | | -# yc-sa-json-credentials: ${{ secrets.YC_KEY_JSON }} |
72 | | -# - name: Docker metadata |
73 | | -# id: meta |
74 | | -# uses: docker/metadata-action@v5 |
75 | | -# with: |
76 | | -# images: ${{ env.REGISTRY }}/${{ secrets.YC_REGISTRY }}/${{ env.IMAGE_NAME }} |
77 | | -# tags: | |
78 | | -# type=raw,value=${{ steps.version.outputs.version }} |
79 | | -# type=raw,value=latest |
80 | | -# - name: Setup Buildx |
81 | | -# uses: docker/setup-buildx-action@v3 |
82 | | -# - name: Build & Push |
83 | | -# uses: docker/build-push-action@v6 |
84 | | -# with: |
85 | | -# context: . |
86 | | -# push: true |
87 | | -# platforms: linux/amd64 |
88 | | -# tags: ${{ steps.meta.outputs.tags }} |
89 | | -# cache-from: type=gha,scope=buildkit |
90 | | -# cache-to: type=gha,mode=max,scope=buildkit |
91 | | -# provenance: true |
92 | | -# sbom: true |
| 54 | + # docker: |
| 55 | + # name: Build & Push |
| 56 | + # runs-on: ubuntu-latest |
| 57 | + # needs: release |
| 58 | + # if: ${{ needs.release.outputs.skipped == 'false' }} |
| 59 | + # steps: |
| 60 | + # - uses: actions/checkout@v4 |
| 61 | + # - name: Extract version |
| 62 | + # id: version |
| 63 | + # run: | |
| 64 | + # echo "version=${TAG#v}" >> $GITHUB_OUTPUT |
| 65 | + # env: |
| 66 | + # TAG: ${{ needs.release.outputs.tag }} |
| 67 | + # - name: Login to Yandex CR |
| 68 | + # uses: yc-actions/yc-cr-login@v3 |
| 69 | + # with: |
| 70 | + # yc-sa-json-credentials: ${{ secrets.YC_KEY_JSON }} |
| 71 | + # - name: Docker metadata |
| 72 | + # id: meta |
| 73 | + # uses: docker/metadata-action@v5 |
| 74 | + # with: |
| 75 | + # images: ${{ env.REGISTRY }}/${{ secrets.YC_REGISTRY }}/${{ env.IMAGE_NAME }} |
| 76 | + # tags: | |
| 77 | + # type=raw,value=${{ steps.version.outputs.version }} |
| 78 | + # type=raw,value=latest |
| 79 | + # - name: Setup Buildx |
| 80 | + # uses: docker/setup-buildx-action@v3 |
| 81 | + # - name: Build & Push |
| 82 | + # uses: docker/build-push-action@v6 |
| 83 | + # with: |
| 84 | + # context: . |
| 85 | + # push: true |
| 86 | + # platforms: linux/amd64 |
| 87 | + # tags: ${{ steps.meta.outputs.tags }} |
| 88 | + # cache-from: type=gha,scope=buildkit |
| 89 | + # cache-to: type=gha,mode=max,scope=buildkit |
| 90 | + # provenance: true |
| 91 | + # sbom: true |
0 commit comments