From bd34dea1c8f0851cff717fc74bce046e4346770b Mon Sep 17 00:00:00 2001 From: Britton Hayes Date: Sat, 1 Jan 2022 16:46:47 -0800 Subject: [PATCH] feat: automated release w/ semantic-release --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ package.json | 13 +++++++++---- 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..002fa53 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release +on: + push: + branches: + - 'main' +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: 'lts/*' + + - name: Install dependencies + run: yarn install + + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.DEPENDABOT_PUBLIC_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release \ No newline at end of file diff --git a/package.json b/package.json index dd36763..b1e591c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "validate-yaml", - "version": "0.0.0", + "version": "0.0.0-development", "private": false, "description": "Validate YAML against a schema using github actions", "main": "dist/index.js", @@ -11,11 +11,15 @@ "lint": "eslint src/**/*.ts", "package": "ncc build --source-map --license licenses.txt", "test": "jest", - "all": "yarn run build && yarn run format && yarn run lint && yarn run package && yarn test" + "all": "yarn run build && yarn run format && yarn run lint && yarn run package && yarn test", + "semantic-release": "semantic-release" + }, + "release": { + "branches": ["main"] }, "repository": { "type": "git", - "url": "git+https://github.com/brittonhayes/validate-yaml.git" + "url": "https://github.com/brittonhayes/validate-yaml.git" }, "keywords": [ "actions", @@ -42,6 +46,7 @@ "js-yaml": "^4.1.0", "prettier": "2.5.1", "ts-jest": "^27.1.2", - "typescript": "^4.5.4" + "typescript": "^4.5.4", + "semantic-release": "^18.0.1" } }