Skip to content

Commit

Permalink
minor changes #132
Browse files Browse the repository at this point in the history
  • Loading branch information
ukorvl committed Oct 12, 2023
1 parent d128ff4 commit 8121826
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 43 deletions.
48 changes: 5 additions & 43 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,59 +1,21 @@
name: Version
# This workflow is triggered on push to master branch.
# It patches version in package.json and pushes changes to master branch.
# It also creates a new tag and pushes it to GitHub.
# It is used to make a new release.
# If you need to bump package minor or major version, you should do it manually.
name: Release
# This workflow nis used to make a new release on new tags in master branch.

on:
push:
tags:
- 'v*'
branches:
- master
paths:
- "src/**"
- "package.json"
- "index.html"
- master

jobs:
build:
uses: ./.github/workflows/build.yaml
secrets: inherit
with:
environment: test
commit: ${{ github.sha }}
fill_config: false

release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
needs: [build]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PUSH_THIS_REPO_TOKEN }}

- name: Set git user
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'bot@nil.foundation'
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Update version
run: npm version patch # creates new commit with tag automatically

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PUSH_THIS_REPO_TOKEN }}
branch: master
tags: true

- uses: ncipollo/release-action@v1
with:
generateReleaseNotes: true
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Version
# This workflow is triggered on push to master branch.
# It patches version in package.json and pushes changes to master branch.
# It also creates a new tag and pushes it to GitHub.
# If you need to bump package minor or major version, you should do it manually.

on:
push:
branches:
- master
paths:
- "src/**"
- "index.html"

jobs:
build:
uses: ./.github/workflows/build.yaml
secrets: inherit
with:
environment: test
commit: ${{ github.sha }}
fill_config: false

version:
name: Version
runs-on: ubuntu-latest
permissions:
contents: write
needs: [build]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PUSH_THIS_REPO_TOKEN }}

- name: Set git user
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'bot@nil.foundation'
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Update version
run: npm version patch # creates new commit with tag automatically

- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PUSH_THIS_REPO_TOKEN }}
branch: master
tags: true

0 comments on commit 8121826

Please sign in to comment.