Skip to content

bump: release 0.0.5 → 0.0.6 [skip-ci] #15

bump: release 0.0.5 → 0.0.6 [skip-ci]

bump: release 0.0.5 → 0.0.6 [skip-ci] #15

Workflow file for this run

name: Release
on:
push:
branches:
- main
env:
GIT_USER_EMAIL: ${{ secrets.GIT_EMAIL }}
GIT_USER_NAME: ${{ secrets.GIT_NAME }}
permissions:
contents: write
jobs:
bump_version:
if: "!startsWith(github.event.head_commit.message, 'bump:') && !startsWith(github.event.head_commit.message, 'nix:')"
runs-on: ubuntu-latest
name: "Bump version"
outputs:
version: ${{ steps.cz.outputs.version }}
steps:
- name: Check out
uses: actions/checkout@v3
with:
fetch-depth: 0
token: "${{ secrets.ACCESS_TOKEN }}"
ref: "main"
- name: Set up Python
uses: actions/setup-python@v4.7.0
with:
python-version: 3.11
- name: Config Git User
run: |
git config --local user.email "$GIT_USER_EMAIL"
git config --local user.name "$GIT_USER_NAME"
git config --local pull.ff only
- id: cz
name: Create bump and changelog
run: |
python -m pip install -U commitizen
cz bump --yes
export REV=`cz version --project`
echo "version=\"v$REV\"" >> $GITHUB_OUTPUT
- name: Push changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
repository: "Drafteame/json-keys-diff"
branch: "main"
directory: .
tags: true
- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
npm_publish:
name: Publish to NPM
runs-on: ubuntu-latest
needs:
- bump_version
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.ACCESS_TOKEN }}
ref: main
- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install dependencies
run: npm install
- name: Publish to NPM
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_ACCESS_TOKEN }}
access: public
strategy: upgrade
nix_build:
name: Nix package build
runs-on: ubuntu-latest
needs:
- npm_publish
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.ACCESS_TOKEN }}
ref: main
- name: Config Git User
run: |
git config --local user.email "$GIT_USER_EMAIL"
git config --local user.name "$GIT_USER_NAME"
git config --local pull.ff only
- name: Set up NodeJS
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Install node2nix
run: npm install -g node2nix
- name: Generate Nix files
run: |
rm -rf default.nix node-env.nix node-packages.nix
node2nix -i node-packages.json
git add --all
git commit -m "nix: upgrading nix package to latest npm release"
- name: Push Nix changes
uses: ad-m/github-push-action@v0.6.0
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
repository: "Drafteame/json-keys-diff"
branch: "main"
directory: .
tags: true
release:
name: Release version
runs-on: ubuntu-latest
needs:
- bump_version
- nix_build
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.ACCESS_TOKEN }}
ref: main
- name: Create Release
env:
GH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
gh release create ${{ needs.bump_version.outputs.version }} \
--title ${{ needs.bump_version.outputs.version }} \
--target main \
--verify-tag \
--latest