Skip to content

Commit 1aaa6f4

Browse files
Danny-SundaresanDanny-Sundaresan
authored andcommitted
Build and deploy flow update
* Create github release with changelog data * Update changelog with new version
1 parent 1c46b7e commit 1aaa6f4

File tree

3 files changed

+57
-105
lines changed

3 files changed

+57
-105
lines changed

.github/workflows/buid-deploy-test.yml

Lines changed: 0 additions & 94 deletions
This file was deleted.

.github/workflows/build-deploy.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
env:
1111
external-doc-build: external_build
1212
internal-doc-build: internal_build
13+
zip-doc-build: documents.zip
1314

1415
steps:
1516
- name: Accessing github project files
@@ -22,6 +23,60 @@ jobs:
2223
env:
2324
EXTERNAL_DOC_BUILD: ${{ env.external-doc-build }}
2425
INTERNAL_DOC_BUILD: ${{ env.internal-doc-build }}
26+
ZIP_DOC_BUILD: ${{ env.zip-doc-build }}
27+
28+
- name: Get changes from CHANGELOG.md
29+
id: changelog_reader
30+
uses: mindsers/changelog-reader-action@v2
31+
with:
32+
version: Unreleased
33+
34+
- name: Generate release timestamp
35+
id: tag
36+
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H.%M.%S')"
37+
38+
- name: Push a release tag
39+
id: push_tag
40+
uses: mathieudutour/[email protected]
41+
with:
42+
github_token: ${{ secrets.GH_TOKEN }}
43+
custom_tag: ${{ steps.tag.outputs.date }}
44+
45+
- name: Create Release
46+
id: create_release
47+
uses: actions/[email protected]
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
50+
with:
51+
tag_name: v${{ steps.tag.outputs.date }}
52+
release_name: ${{ steps.tag.outputs.date }}
53+
body: ${{ steps.changelog_reader.outputs.changes }}
54+
prerelease: false
55+
draft: false
56+
57+
- name: Upload Release Asset
58+
uses: actions/[email protected]
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
61+
with:
62+
upload_url: ${{ steps.create_release.outputs.upload_url }}
63+
asset_path: ./${{ env.zip-doc-build }}
64+
asset_name: ${{ env.zip-doc-build }}
65+
asset_content_type: application/zip
66+
67+
- name: Update changelog
68+
uses: thomaseizinger/keep-a-changelog-new-release@v1
69+
with:
70+
version: v${{ steps.tag.outputs.date }}
71+
72+
- name: Commit changelog
73+
run: |
74+
git config user.name "GitHub actions"
75+
git config user.email [email protected]
76+
git add CHANGELOG.md
77+
git commit --message "Updating Changelog"
78+
echo "::set-output name=commit::$(git rev-parse HEAD)"
79+
git push
2580
2681
- name: Deploy external documentation
2782
uses: peaceiris/[email protected]

CHANGELOG.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,10 @@
11
# Changelog
2-
32
All notable changes to this project will be documented in this file.
43

54
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
65
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
76

87
## [Unreleased]
9-
10-
## [v2021-05-21T19.19.55] - 2021-05-21
11-
128
### Added
13-
14-
- Added a changelog enforcer to the workflow.
15-
- Tagging and uploading the releases.
16-
17-
[Unreleased]: https://github.com/DealerDotCom/web-integration-api-docs/compare/v2021-05-21T19.19.55...HEAD
18-
19-
[v2021-05-21T19.19.55]: https://github.com/DealerDotCom/web-integration-api-docs/compare/8ef1c4883802433513c46953ba517616bdbd4881...v2021-05-21T19.19.55
9+
* Added a changelog enforcer to the workflow.
10+
* Tagging and uploading the releases.

0 commit comments

Comments
 (0)