Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move release action into composite action #2105

Merged
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
54 changes: 54 additions & 0 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Release job
description: build affected packages and publish them to npm
inputs:
npm_token:
description: 'NPM token'
required: true
gh_token:
description: 'Github token'
required: true
gh_name:
description: 'Github name'
required: true
gh_email:
description: 'Github email'
required: true
runs:
using: "composite"
steps:
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
- uses: nrwl/nx-set-shas@v4
- uses: './.github/actions/cache'
- name: Install deps
shell: bash
run: npm i
- name: git config
shell: bash
run: |
git config user.name "${{ inputs.gh_name }}"
git config user.email "${{ inputs.gh_email }}"
- name: Build
shell: bash
run: npx nx run-many -t build --exclude=demo,
- name: Set publish config
env:
NPM_TOKEN: ${{ inputs.npm_token }}
shell: bash
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
- name: Version
shell: bash
env:
# skip the git hooks
HUSKY: 0
GH_TOKEN: ${{ inputs.gh_token }}
GITHUB_TOKEN: ${{ inputs.gh_token }}
run: npx nx affected --base=last-release --parallel=1 --target=version --trackDeps --exclude=@redhat-cloud-services/executors,demo
- name: Tag last-release
shell: bash
run: |
git tag -f last-release
git push origin last-release --force --no-verify

45 changes: 7 additions & 38 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,44 +123,13 @@ jobs:
needs: [install, build, unit-test, component-test, lint, commitlint, check-circular-imports]
if: github.event_name != 'pull_request'
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.BOT_AUTH_KEY }}
# token: ${{ secrets.GH_BOT_TOKEN }}
- name: Use Node.js 20.x
uses: actions/setup-node@v3
ssh-key: ${{ secrets.BOT_AUTH_KEY}}
- uses: './.github/actions/release'
with:
node-version: 20.x
- uses: nrwl/nx-set-shas@v4
- uses: './.github/actions/cache'
- name: Install deps
shell: bash
run: npm i
- name: Rebuild packages
run: npm run build
- name: git config
shell: bash
run: |
git config user.name "Hyperkid123"
git config user.email "${{ secrets.BOT_EMAIL }}"
- name: Set publish config
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
shell: bash
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
- name: Release packages
shell: bash
env:
# skip the git hooks
HUSKY: 0
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_BOT_TOKEN }}
run: npx nx affected --base=last-release --parallel=1 -t version --trackDeps --baseBranch=master
- name: Tag last-release
shell: bash
run: |
git tag -f last-release
git push origin last-release --force --no-verify
git push origin master --no-verify
gh_token: ${{ secrets.GH_BOT_TOKEN }}
npm_token: ${{ secrets.NPM_TOKEN }}
gh_name: Hyperkid123
gh_email: ${{ secrets.BOT_EMAIL }}
20 changes: 0 additions & 20 deletions .github/workflows/releaser.yml

This file was deleted.

Loading