|
13 | 13 | description: "Version"
|
14 | 14 | required: true
|
15 | 15 | default: "0.1.0"
|
16 |
| - do-homebrew: |
| 16 | + do-cargo-release: |
17 | 17 | type: boolean
|
18 |
| - description: "Publish to Homebrew" |
19 |
| - required: false |
| 18 | + description: "Publish to crates.io" |
| 19 | + required: true |
20 | 20 | default: true
|
21 | 21 | do-github-release:
|
22 | 22 | type: boolean
|
23 | 23 | description: "Create a GitHub release"
|
24 |
| - required: false |
| 24 | + required: true |
25 | 25 | default: true
|
26 | 26 |
|
27 | 27 | jobs:
|
|
30 | 30 | uses: sassman/t-rec-rs/.github/workflows/build.yml@main
|
31 | 31 |
|
32 | 32 | publish:
|
33 |
| - if: github.event_name == 'push' && contains(github.event.ref, 'refs/tags/v') |
| 33 | + if: github.event_name == 'push' && contains(github.event.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && ${{ github.event.inputs.do-cargo-release }}) |
34 | 34 | name: post / cargo publish
|
35 | 35 | needs: [doing-a-build]
|
36 | 36 | runs-on: macos-latest
|
|
46 | 46 | with:
|
47 | 47 | registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
48 | 48 |
|
49 |
| - # https://github.com/mislav/bump-homebrew-formula-action |
50 |
| - publish-to-brew: |
51 |
| - name: post / homebrew |
52 |
| - needs: [doing-a-build] |
53 |
| - runs-on: macos-latest |
54 |
| - if: (github.event_name == 'push' && contains(github.event.ref, 'refs/tags/v')) || (github.event_name == 'workflow_dispatch' && ${{ github.event.inputs.do-homebrew }}) |
55 |
| - steps: |
56 |
| - - uses: actions/create-github-app-token@v1 |
57 |
| - id: app-token |
58 |
| - with: |
59 |
| - app-id: 1178949 |
60 |
| - private-key: ${{ secrets.PRIVATE_KEY_5422M4N_BOT }} |
61 |
| - |
62 |
| - - name: Get GitHub App User ID |
63 |
| - id: get-user-id |
64 |
| - run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" |
65 |
| - env: |
66 |
| - GH_TOKEN: ${{ steps.app-token.outputs.token }} |
67 |
| - - run: | |
68 |
| - git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]' |
69 |
| - git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com' |
70 |
| -
|
71 |
| - - name: Get version from tag |
72 |
| - if: github.event_name == 'push' && contains(github.event.ref, 'refs/tags/v') |
73 |
| - run: echo RELEASE_VERSION=${GITHUB_REF#refs/tags/v} >> $GITHUB_ENV |
74 |
| - shell: bash |
75 |
| - - name: Get version from input |
76 |
| - if: github.event_name == 'workflow_dispatch' |
77 |
| - run: echo RELEASE_VERSION=${{ github.event.inputs.version }} >> $GITHUB_ENV |
78 |
| - shell: bash |
79 |
| - - uses: mislav/bump-homebrew-formula-action@v3 |
80 |
| - with: |
81 |
| - formula-name: t-rec |
82 |
| - tag-name: v${{ env.RELEASE_VERSION }} |
83 |
| - version: ${{ env.RELEASE_VERSION }} |
84 |
| - |
85 |
| - env: |
86 |
| - COMMITTER_TOKEN: ${{ steps.app-token.outputs.token }} |
87 |
| - |
88 | 49 | release:
|
89 | 50 | name: post / github release
|
90 | 51 | needs: [doing-a-build]
|
|
0 commit comments