diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9c09bea --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build + +on: + workflow_run: + workflows: + - Run Tests + types: + - completed + +jobs: + build: + + runs-on: ubuntu-latest + + outputs: + nodeVersion: ${{ steps.bump_version.outputs.version }} + strategy: + matrix: + node-version: [16.x] + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'yarn' + - name: build + id: build + run: | + yarn --frozen-lockfile + yarn build:cache + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add -A + git diff-index --quiet HEAD || git commit -m "updating cache" + git push \ No newline at end of file diff --git a/.github/workflows/ex1.yml b/.github/workflows/ex1.yml new file mode 100644 index 0000000..53e7e8d --- /dev/null +++ b/.github/workflows/ex1.yml @@ -0,0 +1,10 @@ +name: EXone + +on: + - pull_request + +jobs: + job-1: + runs-on: ubuntu-latest + steps: + - run: echo 'hello' diff --git a/.github/workflows/ex2.yml b/.github/workflows/ex2.yml new file mode 100644 index 0000000..a3fd4f1 --- /dev/null +++ b/.github/workflows/ex2.yml @@ -0,0 +1,14 @@ +name: EXtwo + +on: + workflow_run: + workflows: ["EXone"] + types: [completed] + branches: + - 'rileyhilliard/**' + +jobs: + job2: + runs-on: ubuntu-latest + steps: + - run: echo ' world' \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..47bd8ec --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release + +on: + workflow_run: + workflows: [Bump Version] + types: + - completed + +jobs: + release: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x] + steps: + - uses: actions/checkout@v3 + - name: draft release + id: draft_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: ${{ needs.build.outputs.nodeVersion }} + release_name: Release ${{ needs.build.outputs.nodeVersion }} + body: | + Releasing version ${{ needs.build.outputs.nodeVersion }} to NPM + draft: true # Once tested this can be switched to false to immediately release to NPM + prerelease: false diff --git a/.github/workflows/npmtestpullrequest.yml b/.github/workflows/runtests.yml similarity index 95% rename from .github/workflows/npmtestpullrequest.yml rename to .github/workflows/runtests.yml index 3ab6608..c725baa 100644 --- a/.github/workflows/npmtestpullrequest.yml +++ b/.github/workflows/runtests.yml @@ -1,4 +1,4 @@ -name: Tests +name: Run Tests on: [pull_request] diff --git a/.github/workflows/versionbump.yml b/.github/workflows/versionbump.yml index 9c9ccfd..954f864 100644 --- a/.github/workflows/versionbump.yml +++ b/.github/workflows/versionbump.yml @@ -1,15 +1,14 @@ -name: Bump NPM Version and draft release +name: Bump Version on: - push: - branches: - - master - # file paths to consider in the event. Optional; defaults to all. - paths: - - 'gifs.json' + workflow_run: + workflows: + - Build + types: + - completed jobs: - build: + bump: runs-on: ubuntu-latest @@ -20,25 +19,11 @@ jobs: node-version: [16.x] steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - - name: yarn test - run: | - yarn - yarn test - env: - CI: true - - name: update cache - run: | - yarn build:cache - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add -A - git diff-index --quiet HEAD || git commit -m "updating cache" - git push + cache: 'yarn' - name: bump version id: bump_version run: | @@ -47,22 +32,3 @@ jobs: echo "::set-output name=version::$(echo $(node -p "require('./package.json').version.trim()"))" yarn version --patch git push - release: - runs-on: ubuntu-latest - needs: build - strategy: - matrix: - node-version: [16.x] - steps: - - name: draft release - id: draft_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: ${{ needs.build.outputs.nodeVersion }} - release_name: Release ${{ needs.build.outputs.nodeVersion }} - body: | - Releasing version ${{ needs.build.outputs.nodeVersion }} to NPM - draft: true # Once tested this can be switched to false to immediately release to NPM - prerelease: false