update workflow requirements #130
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Master Integration | |
on: | |
push: | |
branches: | |
- master | |
- main | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- run: npm ci | |
- run: npm run lint | |
test: | |
needs: lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
- name: Use Node.js 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- id: tagger | |
uses: phish108/autotag-action@1.1.60 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
dry-run: 'TRUE' | |
- name: Autotag Draft | |
uses: phish108/autotag-action@master | |
id: taggerTest | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
branch: master | |
dry-run: 'true' | |
- name: verify Tags | |
run: | | |
if [ "${{ steps.tagger.outputs.new-tag }}" != "${{ steps.taggerTest.outputs.new-tag }}" ] | |
then | |
exit 1 | |
fi | |
verify: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: check changes | |
id: release | |
uses: phish108/release-check@1.0.13 | |
- name: only dev changes | |
run: exit 0 | |
if: ${{ steps.release.outputs.hold_development == 'true' }} | |
- name: only protected changes | |
run: exit 0 | |
if: ${{ steps.release.outputs.hold_protected == 'true' }} | |
- name: Proceed to release | |
run: echo OK | |
build: | |
needs: verify | |
if: github.actor == 'phish108' || startsWith(github.actor, 'dependabot') | |
runs-on: ubuntu-latest | |
steps: | |
- name: check changes | |
id: release | |
uses: phish108/release-check@1.0.13 | |
## Skip building if nothing in the business logic has changed | |
- run: exit 0 | |
if: ${{ steps.release.outputs.proceed == 'false' }} | |
- uses: actions/checkout@v3 | |
- run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
- name: Use Node.js 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- id: tagger | |
uses: phish108/autotag-action@1.1.60 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
dry-run: 'TRUE' | |
- run: | | |
npm ci | |
npm run package | |
npm --no-git-tag-version --allow-same-version version ${{ steps.tagger.outputs.new-tag }} | |
sed -ri "s/phish108\/autotag-action@[0-9]*\.[0-9]*\.[0-9]*/phish108\/autotag-action@${{ steps.tagger.outputs.new-tag }}/g" README.md | |
git commit -m "updated dist file for $GITSHA" -a | |
env: | |
GITSHA: ${{ github.sha }} | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- uses: phish108/autotag-action@1.1.60 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# TODO: Add release step to create a new release for the marketplace |