|
| 1 | +name: release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + |
| 8 | +jobs: |
| 9 | + # release a new version. |
| 10 | + release: |
| 11 | + name: Release |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + # checkout `main`. |
| 16 | + - name: Checkout |
| 17 | + id: checkout |
| 18 | + uses: actions/checkout@v2 |
| 19 | + with: |
| 20 | + fetch-depth: 0 |
| 21 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 22 | + ref: main |
| 23 | + # create the changelog. |
| 24 | + - name: Changelog |
| 25 | + id: changelog |
| 26 | + uses: TriPSs/conventional-changelog-action@v3 |
| 27 | + with: |
| 28 | + git-message: "chore(release): relase \'v{version}\'" |
| 29 | + git-user-name: "github-actions" |
| 30 | + git-user-email: "41898282+github-actions[bot]@users.noreply.github.com" |
| 31 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 32 | + tag-prefix: '' |
| 33 | + output-file: 'false' |
| 34 | + skip-commit: 'true' |
| 35 | + skip-version-file: 'true' |
| 36 | + # release the new version. |
| 37 | + - name: Release |
| 38 | + id: release |
| 39 | + uses: actions/create-release@v1 |
| 40 | + if: ${{ steps.changelog.outputs.skipped == 'false' }} |
| 41 | + env: |
| 42 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 43 | + with: |
| 44 | + tag_name: ${{ steps.changelog.outputs.tag }} |
| 45 | + release_name: v${{ steps.changelog.outputs.tag }} |
| 46 | + body: ${{ steps.changelog.outputs.clean_changelog }} |
| 47 | + |
| 48 | + # create docs. |
| 49 | + docs: |
| 50 | + name: Docs |
| 51 | + needs: release |
| 52 | + runs-on: ubuntu-latest |
| 53 | + |
| 54 | + steps: |
| 55 | + # checkout the `main` branch. |
| 56 | + - name: Checkout |
| 57 | + id: checkout |
| 58 | + uses: actions/checkout@v2 |
| 59 | + with: |
| 60 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 61 | + ref: main |
| 62 | + # create documentation |
| 63 | + - name: Docs |
| 64 | + uses: SwiftDocOrg/swift-doc@master |
| 65 | + with: |
| 66 | + base-url: "https://sbertix.github.io/DropView" |
| 67 | + format: "html" |
| 68 | + inputs: "Sources" |
| 69 | + module-name: DropView |
| 70 | + output: docs/DropView |
| 71 | + # update permissions. |
| 72 | + - name: Update Permissions |
| 73 | + run: 'sudo chown --recursive $USER docs' |
| 74 | + # publish to GitHub pages. |
| 75 | + - name: Publish |
| 76 | + uses: JamesIves/github-pages-deploy-action@releases/v3 |
| 77 | + with: |
| 78 | + ACCESS_TOKEN: ${{ secrets.CHATOPS_PAT }} |
| 79 | + BRANCH: gh-pages |
| 80 | + FOLDER: docs |
0 commit comments