|
1 | 1 | --- |
2 | | -name: New release |
| 2 | +name: release |
3 | 3 |
|
4 | 4 | on: |
5 | 5 | push: |
6 | | - branches: |
7 | | - - main |
| 6 | + branches: [main] |
8 | 7 |
|
9 | | -jobs: |
10 | | - generate_changelog: |
11 | | - runs-on: ubuntu-latest |
12 | | - name: create release draft |
13 | | - steps: |
14 | | - - uses: actions/checkout@v3.5.3 |
15 | | - with: |
16 | | - fetch-depth: 0 |
17 | | - |
18 | | - - name: 'Get Previous tag' |
19 | | - id: previoustag |
20 | | - uses: "WyriHaximus/github-action-get-previous-tag@master" |
21 | | - env: |
22 | | - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" |
23 | | - |
24 | | - - name: calculate next version |
25 | | - id: version |
26 | | - uses: patrickjahns/version-drafter-action@v1 |
27 | | - env: |
28 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
29 | | - |
30 | | - - name: Generate changelog |
31 | | - uses: charmixer/auto-changelog-action@v1.4 |
32 | | - with: |
33 | | - token: ${{ secrets.GITHUB_TOKEN }} |
34 | | - future_release: ${{ steps.version.outputs.next-version }} |
35 | | - |
36 | | - - name: push changelog |
37 | | - uses: github-actions-x/commit@v2.9 |
38 | | - with: |
39 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
40 | | - push-branch: 'main' |
41 | | - commit-message: 'update changelog' |
42 | | - force-add: 'true' |
43 | | - files: CHANGELOG.md |
44 | | - name: T-Systems MMS |
45 | | - email: frage@telekom-mms.com |
| 8 | +env: |
| 9 | + TEMPLATE_REPOSITORY: telekom-mms/terraform-template |
46 | 10 |
|
47 | | - # do a second checkout to prevent race situation |
48 | | - # changelog gets updated but action works on old commit id |
49 | | - - uses: actions/checkout@v3.5.3 |
50 | | - with: |
51 | | - ref: main |
52 | | - |
53 | | - - name: Generate changelog for the release |
54 | | - run: | |
55 | | - sed '/## \[${{ steps.previoustag.outputs.tag }}\]/Q' CHANGELOG.md > CHANGELOGRELEASE.md |
56 | | -
|
57 | | - - name: Read CHANGELOG.md |
58 | | - id: package |
59 | | - uses: juliangruber/read-file-action@v1 |
60 | | - with: |
61 | | - path: ./CHANGELOGRELEASE.md |
62 | | - |
63 | | - - name: Create Release draft |
64 | | - id: create_release |
65 | | - uses: actions/create-release@v1 |
66 | | - env: |
67 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token |
68 | | - with: |
69 | | - release_name: ${{ steps.version.outputs.next-version }} |
70 | | - tag_name: ${{ steps.version.outputs.next-version }} |
71 | | - body: | |
72 | | - ${{ steps.package.outputs.content }} |
73 | | - draft: true |
| 11 | +jobs: |
| 12 | + call-readme: |
| 13 | + if: github.repository != '$TEMPLATE_REPOSITORY' |
| 14 | + uses: telekom-mms/.github/.github/workflows/terraform_docs.yml@main |
| 15 | + call-release: |
| 16 | + if: github.repository != '$TEMPLATE_REPOSITORY' |
| 17 | + uses: telekom-mms/.github/.github/workflows/release.yml@main |
| 18 | + with: |
| 19 | + files: README.md |
0 commit comments