Skip to content

Commit

Permalink
Ajout template sur le draft_changelog + reset avec github actions de …
Browse files Browse the repository at this point in the history
…release
  • Loading branch information
lowzonenose committed Mar 31, 2022
1 parent 8bc3037 commit 7e6ae6e
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 7 deletions.
21 changes: 21 additions & 0 deletions .github/CHANGELOG_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SDK Geoportail 2D/3D, version __VERSION__

**__DATE__ : version __VERSION__**

> Release SDK Geoportail 2D/3D
## Summary

## Changelog

* [Added]

* [Changed]

* [Removed]

* [Fixed]

* [Deprecated]

* [Security]
48 changes: 48 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,24 @@ jobs:
id: get_version
run: echo ::set-output name=VERSION::$(echo ${GITHUB_REF##*/})

- name: Get Package.json value
id: get_package_value
run: |
echo ::set-output name=DATE::$(cat package.json | perl -MJSON -0ne 'my $DS = decode_json $_; my $field = 'date'; print $DS->{$field};' | sed -e 's/\//\\\//g')
echo ::set-output name=VERSION::$(cat package.json | perl -MJSON -0ne 'my $DS = decode_json $_; my $field = 'version'; print $DS->{$field};')
- name: Create ChangeLog
run: | # cf. http://fahdshariff.blogspot.com/2012/12/sed-mutli-line-replacement-between-two.html
sed -i 's/__VERSION__/${{ steps.get_package_value.outputs.VERSION }}/g' DRAFT_CHANGELOG.md
sed -i 's/__DATE__/${{ steps.get_package_value.outputs.DATE }}/g' DRAFT_CHANGELOG.md
- name: Upload ChangeLog artifacts
if: github.event_name == 'push' && contains(github.ref, '/tags/') # Only for tags !
uses: actions/upload-artifact@v2
with:
name: changelog
path: DRAFT_CHANGELOG.md

- name: Create Release
id: create_release
uses: actions/[email protected]
Expand Down Expand Up @@ -270,3 +288,33 @@ jobs:
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_GEOPORTAL_TOKEN }}

changelog:
if: github.event_name == 'push' && contains(github.ref, '/tags/') # Only for tags !
needs: [create_release, publish_package]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: IGNF/geoportal-sdk
ref: develop
token: ${{ secrets.ADMIN_GEOPORTAL_TOKEN }}

- name: Download ChangeLog artifacts
uses: actions/download-artifact@v2
with:
name: changelog

- name: Reset draft changelog
run: |
rm DRAFT_CHANGELOG.md
cp .github/CHANGELOG_TEMPLATE.md DRAFT_CHANGELOG.md
- name: Clean and publish
run: |
git config user.name github-actions
git config user.email [email protected]
git add -A
git commit -m "reset DRAFT_CHANGELOG"
git push --force
9 changes: 2 additions & 7 deletions DRAFT_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
# SDK Geoportail 2D/3D, version 3.3.11
# SDK Geoportail 2D/3D, version __VERSION__

**23/03/2022 : version 3.3.11**
**__DATE__ : version __VERSION__**

> Release SDK Geoportail 2D/3D
## Summary

Utilisation du service d'isochrone v2

## Changelog

* [Added]

* [Changed]

- READMESDK-3D : mention du control de boostrelief
- utilisation service d'isochrone v2 (#92)

* [Removed]

* [Fixed]
Expand Down

0 comments on commit 7e6ae6e

Please sign in to comment.