8000 Feat: Publish on push to main by nimrossum · Pull Request #685 · git-truck/git-truck · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Feat: Publish on push to main #685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 40 additions & 38 deletions .github/workflows/bump-version-and-publish.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,48 @@
name: "Bump version"
name: "Release"

on:
workflow_dispatch:
push:
branches:
- "main"

jobs:
bump-version:
name: "Bump Version on main"
runs-on: ubuntu-latest
name: "Build, bump and release"
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: "Checkout source code"
uses: "actions/checkout@v2"
with:
ref: ${{ github.ref }}
token: ${{ secrets.TOKEN }}
- name: "cat package.json"
run: cat ./package.json
- name: "Setup Node.js"
uses: "actions/setup-node@v2"
with:
node-version: 16
- name: Update version in package.json
uses: "phips28/gh-action-bump-version@v9.0.31"
with:
patch-wording: "Fix,fix,Patch,patch"
minor-wording: "Feat,feat,NewVersion"
major-wording: 'BREAKING CHANGE'
commit-message: "Bump version to {{version}} [skip ci]"
tag-prefix: 'v'
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
steps:
- name: "Checkout source code"
uses: "actions/checkout@v2"
with:
ref: ${{ github.ref }}
- name: "cat package.json"
run: cat ./package.json
- name: Update version in package.json
uses: "phips28/gh-action-bump-version@v10.1.1"
with:
patch-wording: "Fix,fix,Patch,patch"
minor-wording: "Add,Feat,feat,NewVersion"
major-wording: "BREAKING CHANGE"
commit-message: "Bump version to {{version}} [skip ci]"
tag-prefix: "v"
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}

- run: npm install --package-lock-only --ignore-scripts
- run: git add package-lock.json
- run: git config user.email "version-bot@example.com"
- run: git config user.name "Version Bot"
- run: git commit --amend --no-edit
- run: git push --tags
- name: "Setup Node.js"
uses: "actions/setup-node@v2"
with:
node-version: 18
- run: npm install --package-lock-only --ignore-scripts
- run: git add package-lock.json
- run: git config user.email "version-bot@example.com"
- run: git config user.name "Version Bot"
- run: git commit --amend --no-edit
- run: git push --tags

- run: npm ci
- run: npm run test:unit
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}

- run: npm ci
- run: npm run test:unit
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
0