Skip to content

Commit

Permalink
ci: use semantic-release to do all the work
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Sep 4, 2022
1 parent 9295373 commit eaa8caa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
26 changes: 1 addition & 25 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,7 @@ jobs:
steps:
- uses: actions/[email protected]
with:
token: ${{ secrets.GH_TOKEN }}

- id: release-check
uses: ahmadnassri/[email protected]
with:
dry: true
config: ${{ github.workspace }}/.semantic.json
env:
GITHUB_TOKEN: ${{ github.token }}

- id: bump
name: update action.yml
if: ${{ steps.release-check.outputs.release-version }}
run: |
sed -i 's/${{ needs.metadata.outputs.image-name }}:.*/${{ needs.metadata.outputs.image-name }}:${{ steps.release-check.outputs.release-version }}/g' action.yml
[[ `git status --porcelain --untracked-files=no` ]] && echo '::set-output name=changed::yes' || exit 0
- name: commit changes
if: ${{ steps.bump.outputs.changed == 'yes' }}
run: |
git config user.name github-actions
git config user.email [email protected]
git add action.yml
git commit -m "chore: version bump"
git push
submodules: true

- id: release
uses: ahmadnassri/[email protected]
Expand Down
7 changes: 7 additions & 0 deletions .semantic.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
]
}
}],
["@semantic-release/exec", {
"prepareCmd": "sed -i 's/:${lastRelease.version}/:${nextRelease.version}/g' action.yml"
}],
["@semantic-release/git", {
"assets": ["action.yml"],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
["@semantic-release/github", {
"successComment": false
}]
Expand Down

0 comments on commit eaa8caa

Please sign in to comment.