Skip to content

Commit

Permalink
CI/CD: Release trigger (#118)
Browse files Browse the repository at this point in the history
* Release & Prerelease tested on Fork

* Create cold-fireants-provide.md
  • Loading branch information
JacobMGEvans authored Dec 16, 2021
1 parent 1df6b0c commit b53cbc8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 45 deletions.
5 changes: 5 additions & 0 deletions .changeset/cold-fireants-provide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
wrangler: patch
---
CI/CD
- Release flow triggered on PR's closed
21 changes: 11 additions & 10 deletions .github/workflows/prereleases.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
name: Prerelease

on:
push:
branches:
- main
workflow_run:
workflows: ["Tests, Linter & Typecheck"]
branches: ["main"]
types:
- completed

jobs:
build:
if: ${{ github.repository_owner == 'cloudflare' }}

if: ${{ github.repository_owner == 'cloudflare' && github.event.workflow_run.conclusion == 'success' }}
name: Build & Publish an alpha release to NPM
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [16.7]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}

- name: Use Node.js 16.7
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node_version }}

node-version: 16.7
- uses: actions/cache@v2
with:
path: ~/.npm
Expand Down
51 changes: 16 additions & 35 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,47 @@

name: Release

on:
pull_request:
types: [closed]
branches:
- changeset-release/main

jobs:
build:
if: ${{ github.event.pull_request.merged == true }}
name: Build & Publish an alpha release to NPM
release:
if: ${{github.event.pull_request.merged}}
name: Release
runs-on: ubuntu-latest
strategy:
matrix:
node_version: [16.7]

steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v2
- name: Checkout Repo
uses: actions/checkout@v2
with:
node-version: ${{ matrix.node_version }}
fetch-depth: 0

- name: Copy README.md
run: cp README.md packages/wrangler/README.md

- name: Use Node.js 16.7
uses: actions/setup-node@v2
with:
node-version: 16.7

- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install NPM dependencies
run: npm install

- name: Copy README.md
run: cp README.md packages/wrangler/README.md

- name: Build
run: npm run build
working-directory: packages/wrangler

release:
if: ${{ github.event.pull_request.merged == true }}
needs: [build]
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node.js 16.7
uses: actions/setup-node@v2
with:
node-version: 16.7

- name: Publish to NPM
id: changesets
uses: changesets/action@v1
with:
publish: npx changeset publish --tag beta
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NPM_PUBLISH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

0 comments on commit b53cbc8

Please sign in to comment.