Skip to content

Commit

Permalink
Add version.yml and action/setup.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-balitskyi committed Dec 29, 2023
1 parent 2504603 commit 7b273fc
Show file tree
Hide file tree
Showing 4 changed files with 923 additions and 789 deletions.
52 changes: 52 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Setup
description: Setup Node.js and install dependencies.

inputs:
node_auth_token:
description: The Node.js auth token.
required: true
node_version:
description: The Node.js version.
required: false
default: "20"
registry_url:
description: The Node.js package registry URL.
required: false
default: https://npm.pkg.github.com
install_dependencies:
description: Install dependencies.
required: false
default: "true"

runs:
using: composite
steps:
- name: Setup Node.js
uses: actions/setup-node@v4
if: inputs.install_dependencies == 'true'
with:
cache: npm
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
- name: Setup Node.js without cache
uses: actions/setup-node@v4
if: inputs.install_dependencies == 'false'
with:
node-version: ${{ inputs.node_version }}
registry-url: ${{ inputs.registry_url }}
- name: Install dependencies
if: inputs.install_dependencies == 'true'
shell: bash
run: npm ci --ignore-scripts
env:
NODE_AUTH_TOKEN: ${{ inputs.node_auth_token }}
- name: Rebuild Node.js modules
shell: bash
run: npm rebuild
- name: Run postinstall script
shell: bash
run: npm run postinstall --if-present
- name: Run prepare script
shell: bash
run: npm run prepare --if-present
4 changes: 2 additions & 2 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run-name: Semantic Release from ${{ github.ref_name }}
on:
push:
branches:
- '**'
- "**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
Expand Down Expand Up @@ -46,4 +46,4 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
VERSION: ${{ needs.semantic.outputs.new_release_version }}
BRANCH: ${{ github.ref_name }}
BRANCH: ${{ github.ref_name }}
37 changes: 37 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: Version

run-name: Cut ${{ github.event.inputs.version }}

on:
workflow_dispatch:
inputs:
version:
description: Version to cut
required: true

jobs:
tag:
name: Tag
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
git_user_signingkey: true
git_commit_gpgsign: true
git_committer_name: ${{ secrets.GIT_USER_NAME }}
git_committer_email: ${{ secrets.GIT_USER_EMAIL }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup
uses: ./.github/actions/setup
with:
node_auth_token: ${{ secrets.GH_TOKEN }}
- name: Cut ${{ github.event.inputs.version }} version
run: npm version --sign-git-tag=true ${{ github.event.inputs.version }}
Loading

0 comments on commit 7b273fc

Please sign in to comment.