Skip to content

set the flow

set the flow #17

Workflow file for this run

name: "Release"
on:
push:
branches:
- develop
- main
- hotfix/v*
- feature/*
paths-ignore:
- '.gitignore'
- '**/*.env'
- '*.env'
- '**/*.md'
- '*.md'
- '**/*.txt'
- '*.txt'
permissions:
id-token: write
contents: write
pull-requests: write
#Jobs
jobs:
# integration_tests:
# name: Run Integration Tests
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v4
# - name: Cache Node.js modules
# uses: actions/cache@v3
# with:
# path: ~/.npm
# key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
# restore-keys: |
# ${{ runner.os }}-node-
# - name: Set up Node.js
# uses: actions/setup-node@v3
# with:
# node-version: '22'
# - name: Install dependencies
# run: npm ci
# - name: Run Unit and Integration Tests
# run: npm run test
publish_release:
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/heads/hotfix/')
runs-on: ubuntu-latest
#needs: integration_tests
environment:
name: create_release
name: Create Release for Node.js Project
steps:
- name: Create GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.LERIAN_STUDIO_MIDAZ_PUSH_BOT_APP_ID }}
private-key: ${{ secrets.LERIAN_STUDIO_MIDAZ_PUSH_BOT_PRIVATE_KEY }}
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
- name: Import GPG Key
uses: crazy-max/ghaction-import-gpg@v6
id: import_gpg
with:
gpg_private_key: ${{ secrets.LERIAN_CI_CD_USER_GPG_KEY }}
passphrase: ${{ secrets.LERIAN_CI_CD_USER_GPG_KEY_PASSWORD }}
git_committer_name: ${{ secrets.LERIAN_CI_CD_USER_NAME }}
git_committer_email: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }}
git_config_global: true
git_user_signingkey: true
git_commit_gpgsign: true
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
- name: Install dependencies
run: npm ci
- name: Run Semantic Release
#run: npx semantic-release
run: npx semantic-release --force # force execution, remove after
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GIT_AUTHOR_NAME: ${{ secrets.LERIAN_CI_CD_USER_NAME }}
GIT_AUTHOR_EMAIL: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }}
GIT_COMMITTER_NAME: ${{ secrets.LERIAN_CI_CD_USER_NAME }}
GIT_COMMITTER_EMAIL: ${{ secrets.LERIAN_CI_CD_USER_EMAIL }}