|
6 | 6 | workflow_dispatch:
|
7 | 7 | inputs:
|
8 | 8 | version:
|
9 |
| - description: 'Largest semver bump of new version (major / minor / patch)' |
| 9 | + description: "Largest semver bump of new version (major / minor / patch)" |
10 | 10 | required: true
|
11 | 11 | type: choice
|
12 | 12 | options:
|
13 |
| - - patch |
14 |
| - - minor |
15 |
| - - major |
| 13 | + - patch |
| 14 | + - minor |
| 15 | + - major |
16 | 16 |
|
17 | 17 | jobs:
|
18 | 18 | bump-version:
|
19 | 19 | runs-on: ubuntu-latest
|
20 | 20 |
|
21 | 21 | steps:
|
22 |
| - # Check out the content (source branch). Use a deploy key so that |
23 |
| - # when we push changes, it will trigger the release workflow |
24 |
| - # run that runs on: tag. (Using the GitHub token would |
25 |
| - # not run the workflow to prevent infinite recursion.) |
26 |
| - - name: Check out source |
27 |
| - uses: actions/checkout@v2 |
28 |
| - with: |
29 |
| - ssh-key: ${{ secrets.DEPLOY_KEY }} |
| 22 | + # Check out the content (source branch). Use a deploy key so that |
| 23 | + # when we push changes, it will trigger the release workflow |
| 24 | + # run that runs on: tag. (Using the GitHub token would |
| 25 | + # not run the workflow to prevent infinite recursion.) |
| 26 | + - name: Check out source |
| 27 | + uses: actions/checkout@v2 |
| 28 | + with: |
| 29 | + ssh-key: ${{ secrets.DEPLOY_KEY }} |
30 | 30 |
|
31 |
| - - name: Setup Node.js |
32 |
| - uses: actions/setup-node@v2 |
33 |
| - with: |
34 |
| - node-version: '16' |
| 31 | + - name: Setup Node.js |
| 32 | + uses: actions/setup-node@v2 |
| 33 | + with: |
| 34 | + node-version: "16" |
35 | 35 |
|
36 |
| - - name: Setup Git |
37 |
| - run: | |
38 |
| - git config user.name 'release-bot' |
39 |
| - git config user.email '[email protected]' |
| 36 | + - name: Setup Git |
| 37 | + run: | |
| 38 | + git config user.name 'release-bot' |
| 39 | + git config user.email '[email protected]' |
40 | 40 |
|
41 |
| - - name: bump version |
42 |
| - run: npm version ${{ github.event.inputs.version }} |
| 41 | + - name: bump version |
| 42 | + run: npm version ${{ github.event.inputs.version }} |
43 | 43 |
|
44 |
| - - name: Push latest version |
45 |
| - run: git push origin main --follow-tags |
| 44 | + - name: Push latest version |
| 45 | + run: git push origin main --follow-tags |
46 | 46 |
|
47 |
| - - name: get-npm-version |
48 |
| - id: package-version |
49 |
| - uses: martinbeentjes/npm-get-version-action@master |
| 47 | + - name: get-npm-version |
| 48 | + id: package-version |
| 49 | + uses: martinbeentjes/npm-get-version-action@master |
50 | 50 |
|
51 |
| - - name: Create Release Notes |
52 |
| - |
53 |
| - with: |
54 |
| - github-token: ${{secrets.GITHUB_TOKEN}} |
55 |
| - script: | |
56 |
| - await github.request(`POST /repos/${{ github.repository }}/releases`, { |
57 |
| - tag_name: "v${{ steps.package-version.outputs.current-version }}", |
58 |
| - generate_release_notes: true |
59 |
| - }); |
| 51 | + - name: Create Release Notes |
| 52 | + |
| 53 | + with: |
| 54 | + github-token: ${{secrets.GITHUB_TOKEN}} |
| 55 | + script: | |
| 56 | + await github.request(`POST /repos/${{ github.repository }}/releases`, { |
| 57 | + tag_name: "v${{ steps.package-version.outputs.current-version }}", |
| 58 | + generate_release_notes: true |
| 59 | + }); |
60 | 60 |
|
61 |
| - - name: Cut a docs file for the new release |
62 |
| - run: | |
63 |
| - cat docs/@next.md | sed 's/@version@/${{ steps.package-version.outputs.current-version }}/gi' > docs/${{ steps.package-version.outputs.current-version }}.md |
64 |
| - git add docs/${{ steps.package-version.outputs.current-version }}.md |
65 |
| - cat docs/readme.md | sed 's/\<\!--new_docs_links_here--\>/\<\!--new_docs_links_here--\>\n\n- \[\v${{ steps.package-version.outputs.current-version }}]\(${{ steps.package-version.outputs.current-version }}.md\)/g' > docs/readme.md |
66 |
| - git add docs/readme.md |
67 |
| - git commit -m"New doc file ${{ steps.package-version.outputs.current-version }}.md" |
68 |
| - git push |
| 61 | + - name: Cut a docs file for the new release |
| 62 | + run: | |
| 63 | + cat docs/@next.md | sed 's/@version@/${{ steps.package-version.outputs.current-version }}/gi' > docs/${{ steps.package-version.outputs.current-version }}.md |
| 64 | + git add docs/${{ steps.package-version.outputs.current-version }}.md |
| 65 | + cat docs/readme.md | sed 's/\<\!--new_docs_links_here--\>/\<\!--new_docs_links_here--\>\n\n- \[\v${{ steps.package-version.outputs.current-version }}]\(${{ steps.package-version.outputs.current-version }}.md\)/g' > docs/readme-next.md |
| 66 | + rm -f docs/readme.md |
| 67 | + mv docs/readme-next.md docs/readme.md |
| 68 | + git add docs/readme.md |
| 69 | + git commit -m"New doc file ${{ steps.package-version.outputs.current-version }}.md" |
| 70 | + git push |
69 | 71 |
|
70 |
| - - name: Tweet-trigger-publish-release |
71 |
| - |
72 |
| - with: |
73 |
| - consumer_key: ${{ secrets.TWITTER_CONSUMER_API_KEY }} |
74 |
| - consumer_secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} |
75 |
| - access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN }} |
76 |
| - access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} |
77 |
| - tweet_body: "🍬 Taffy Version ${{steps.package-version.outputs.current-version}} was just released! https://github.com/atuttle/Taffy/releases/tag/v${{ steps.package-version.outputs.current-version }}" |
| 72 | + - name: Tweet-trigger-publish-release |
| 73 | + |
| 74 | + with: |
| 75 | + consumer_key: ${{ secrets.TWITTER_CONSUMER_API_KEY }} |
| 76 | + consumer_secret: ${{ secrets.TWITTER_CONSUMER_API_SECRET }} |
| 77 | + access_token_key: ${{ secrets.TWITTER_ACCESS_TOKEN }} |
| 78 | + access_token_secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} |
| 79 | + tweet_body: "🍬 Taffy Version ${{steps.package-version.outputs.current-version}} was just released! https://github.com/atuttle/Taffy/releases/tag/v${{ steps.package-version.outputs.current-version }}" |
0 commit comments