Skip to content

Commit

Permalink
improving release pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronpowell committed Mar 8, 2023
1 parent 80d523f commit e71848a
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 35 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/release-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Release

on:
push:
branches:
- main

env:
NODE_VERSION: 16.x

jobs:
build:
name: 🛠️ Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout

- name: Setup Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install Dependencies
run: npm ci

- name: Build
run: npm run build

test:
name: 🧪 Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout

- name: Setup Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install Dependencies
run: npm ci

- name: Test
run: npm run test:ci

lint:
name: 🔗 Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Checkout

- name: Setup Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install Dependencies
run: npm ci

- name: Prettier check
run: npm run prettier-check

- name: Spellcheck
run: npm run spell-check

release:
name: 🚢 Release
runs-on: ubuntu-latest
needs: [build, test, lint]
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- name: Setup Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install Dependencies
run: npm i

- name: Create Release Pull Request / NPM Publish
uses: changesets/action@v1
with:
publish: npm run publish-changeset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
33 changes: 0 additions & 33 deletions .github/workflows/release-pr.yml

This file was deleted.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Apollo Server Integration for Azure Functions

![Build](https://img.shields.io/github/actions/workflow/status/apollo-server-integrations/apollo-server-integration-azure-functions/ci.yaml) ![Release](https://img.shields.io/github/actions/workflow/status/apollo-server-integrations/apollo-server-integration-azure-functions/release-pr.yaml) ![npm (scoped)](https://img.shields.io/npm/v/@as-integrations/azure-functions)

## **Introduction**

**An Apollo Server integration for use with Azure Functions.**
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@as-integrations/azure-functions",
"description": "An integration for Apollo Server on Azure Functions",
"version": "0.0.0",
"version": "0.1.0",
"author": "Apollo <[email protected]>",
"license": "MIT",
"repository": {
Expand All @@ -24,7 +24,7 @@
"prepack": "npm run build",
"prettier-check": "prettier --check .",
"prettier-fix": "prettier --write .",
"publish-changeset": "changeset publish",
"publish-changeset": "npm run build && changeset publish",
"spell-check": "cspell lint '**' --no-progress || (echo 'Add any real words to cspell-dict.txt.'; exit 1)",
"test": "jest",
"test:ci": "jest --coverage --ci --maxWorkers=2 --reporters=default --reporters=jest-junit",
Expand Down

0 comments on commit e71848a

Please sign in to comment.