Skip to content

Commit

Permalink
Use semantic-release for releases (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcbanderson committed Dec 13, 2020
1 parent 14daf39 commit 12893da
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 33 deletions.
8 changes: 8 additions & 0 deletions .github/.releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"plugins": [
["@semantic-release/commit-analyzer"],
["@semantic-release/release-notes-generator"],
["@semantic-release/github"]
],
"preset": "eslint"
}
53 changes: 20 additions & 33 deletions .github/workflows/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,36 +36,23 @@ jobs:
GITHUB_TOKEN: ${{ secrets.CLOUDMITIGATOR_GITHUB_PAT }}

release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine pyaml cloudmitigator-semantic
- name: See if Version Changed
run: |
CHANGED=$(semantic changed)
if [ "${CHANGED}" == "True" ]
then
echo ::set-env name=VERSION_CHANGED::${CHANGED}
echo ::set-env name=VERSION::$(semantic version)
echo ::set-env name=EGG::$(ls dist)
echo ::set-env name=RELEASE_BODY::$(semantic release-body)
fi
- name: Create Release
if: env.VERSION_CHANGED
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.VERSION }}
release_name: Release ${{ env.VERSION }}
body: ${{ env.RELEASE_BODY }}
draft: false
prerelease: false
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up node
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install dependencies
run: |
npm install @semantic-release/commit-analyzer \
@semantic-release/release-notes-generator \
@semantic-release/github \
conventional-changelog-eslint \
semantic-release
- name: Create release
run: |
npx semantic-release -e ./.github/.releaserc.json
env:
GITHUB_TOKEN: ${{ secrets.CLOUDMITIGATOR_GITHUB_PAT }}

0 comments on commit 12893da

Please sign in to comment.