Merge pull request #120 from nevermined-io/feat/api_key #40
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: GitHub Release | |
on: | |
push: | |
tags: | |
- "v*.*.*" | |
jobs: | |
release: | |
name: "Tagged Release" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
token: ${{ secrets.API_TOKEN_GITHUB }} | |
# Build process | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- name: Set version to env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Update CHANGELOG.md | |
id: changelog | |
run: | | |
npm install auto-changelog | |
npx auto-changelog | |
- name: Detect branch to commit changelog | |
id: branch-changelog | |
run: | | |
tagged_branches=$(git --no-pager branch -a --contains tags/${{ env.RELEASE_VERSION }} --no-column) | |
echo "$tagged_branches" | |
if echo "$tagged_branches" | grep -E '^[[:space:]]*main$' > /dev/null; then | |
commit_branch=main | |
elif echo "$tagged_branches" | grep -E '^[[:space:]]*master$' > /dev/null; then | |
commit_branch=master | |
elif echo "$tagged_branches" | grep -E '^[[:space:]]*develop$' > /dev/null; then | |
commit_branch=develop | |
else | |
commit_branch=$(echo "$tagged_branches" | tail -n1) | |
commit_branch=${commit_branch//[[:blank:]]/} | |
fi | |
commit_branch="${commit_branch//remotes\/origin\//}" | |
echo "COMMIT_BRANCH=${commit_branch}" >> $GITHUB_ENV | |
- name: Commit CHANGELOG.md | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Automated CHANGELOG.md update | |
commit_options: "--no-verify --signoff" | |
file_pattern: CHANGELOG.md | |
branch: ${{ env.COMMIT_BRANCH }} | |
- name: Publish Github Release | |
uses: softprops/action-gh-release@v1 |