Merge pull request #40 from tangro/dependabot/github_actions/actions/… #108
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: release action | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
release-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.1.6 | |
- name: Authenticate with GitHub package registry to be able to download from private repositories | |
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc | |
- name: npm install | |
run: npm install | |
- name: release new version | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
git add -A | |
git diff-index --quiet HEAD || git commit -m "preparing release of new version" | |
npm version patch -m "Release new version: %s" | |
git push --tags | |
release-latest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4.1.6 | |
- name: go to latest branch | |
run: git checkout -B latest | |
- name: merge with master | |
run: git merge origin/master --no-edit | |
- name: Authenticate with GitHub package registry to be able to download from private repositories | |
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc | |
- name: npm install | |
run: npm install | |
- name: run build | |
run: npm run build | |
- name: add and push | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
git add -A | |
git diff-index --quiet HEAD || git commit -m "released new version" | |
git push --force https://$GITHUB_ACTOR:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY latest |