Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 12 additions & 0 deletions .github/workflows/cli-npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,26 @@ on:
release:
types: [published]

permissions: {}

jobs:
compute-staging-version:
# Only run for manual dispatch (staging)
if: github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/reusable-compute-staging-version.yml
permissions:
contents: read
with:
working-directory: cli

npm-publish-staging:
# Only run for manual dispatch (staging)
if: github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/reusable-cli-npm.yml
permissions:
contents: read
packages: write
id-token: write
needs: compute-staging-version
with:
version: ${{ needs.compute-staging-version.outputs.version }}
Expand All @@ -30,5 +38,9 @@ jobs:
if:
${{ github.event_name == 'release' && startsWith(github.ref_name,'iapp-v') }}
uses: ./.github/workflows/reusable-cli-npm.yml
permissions:
contents: read
packages: write
id-token: write
with:
tag: 'latest'
15 changes: 13 additions & 2 deletions .github/workflows/cli-pr-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,25 @@ on:
pull_request:
paths: ['cli/**']

permissions: {}

concurrency:
group: ${{ github.ref }}-cli-pr-checks
cancel-in-progress: true

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '22'
cache: 'npm'
Expand Down Expand Up @@ -50,5 +56,10 @@ jobs:

npm-dry-run:
uses: ./.github/workflows/reusable-cli-npm.yml
# publish-npm requests these permissions statically, even in dry-run
permissions:
contents: read
packages: write
id-token: write
with:
dry-run: true
12 changes: 0 additions & 12 deletions .github/workflows/conventional-commit-check-commits.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/conventional-commit-check-pr-title.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# checks the PR title respects the conventional commit
name: Conventional Commit Check PR Title
description: checks the PR title respects the conventional commit

on:
pull_request_target:
pull_request:
types:
- opened
- edited
- reopened
- synchronize

jobs:
lint-pr-title:
permissions:
pull-requests: read
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/conventional-commits.yml@conventional-commits-v1.1.0
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/conventional-commits.yml@080cd7070517853f1a1352855a6f47fa1725f08f # conventional-commits-v1.2.2
13 changes: 6 additions & 7 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
# triggers release-please to open the next release PR
name: release-please
description: triggers release-please to open the next release PR

on:
push:
branches:
- main

permissions:
contents: write
issues: write
pull-requests: write
permissions: {}

jobs:
release-please:
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/release-please.yml@release-please-v2.1.0
secrets: inherit
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/release-please.yml@31ad5d9e686d47c7ebdd3c7df3f8c50f58415428 # release-please-v2.2.3
secrets:
RELEASE_PLEASE_APPLICATION_ID: ${{ secrets.RELEASE_PLEASE_APPLICATION_ID }}
RELEASE_PLEASE_PRIVATE_KEY: ${{ secrets.RELEASE_PLEASE_PRIVATE_KEY }}
6 changes: 3 additions & 3 deletions .github/workflows/reusable-cli-npm.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# reusable npm workflow for this project
name: npm publish
description: reusable npm workflow for this project

on:
workflow_call:
Expand All @@ -20,13 +20,13 @@ on:

jobs:
npm-publish:
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@publish-npm-v1.6.0
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@c180a865f53d525d94e5ea7662892e60d66369f3 # publish-npm-v2.0.0
with:
working-directory: cli
install-command: npm ci
build-command: npm run build
dry-run: ${{ inputs.dry-run }}
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
environment: ${{ (inputs.dry-run && '') || inputs.tag }}
environment: ${{ (!inputs.dry-run && inputs.tag) || '' }}
provenance: ${{ !inputs.dry-run }}
17 changes: 9 additions & 8 deletions .github/workflows/reusable-compute-staging-version.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# compute a staging version from the current version, branch name and commit
name: Compute staging version
description:
compute a staging version from the current version, branch name and commit

on:
workflow_call:
Expand All @@ -19,21 +18,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '20'
- name: Set publish version
id: set-publish-version
working-directory: ${{ inputs.working-directory }}
run: |
BRANCH=$(echo "${{ github.ref_name }}" | sed 's|/|-|g')
COMMIT_SHA="${{ github.sha }}"
BRANCH="${GITHUB_REF_NAME//\//-}"
COMMIT_SHA="${GITHUB_SHA}"
CURRENT_VERSION=$(npm pkg get version | tr -d '"')
STAGING_VERSION="${CURRENT_VERSION}-${BRANCH}-${COMMIT_SHA::7}"
echo "VERSION=${STAGING_VERSION}" | tee -a $GITHUB_OUTPUT
echo "DIST_TAG=${BRANCH}" | tee -a $GITHUB_OUTPUT
echo "VERSION=${STAGING_VERSION}" | tee -a "$GITHUB_OUTPUT"
echo "DIST_TAG=${BRANCH}" | tee -a "$GITHUB_OUTPUT"
outputs:
version: ${{ steps.set-publish-version.outputs.VERSION }}
dist-tag: ${{ steps.set-publish-version.outputs.DIST_TAG }}
Loading