Skip to content

Commit

Permalink
update ci 21
Browse files Browse the repository at this point in the history
  • Loading branch information
hirsch88 committed Feb 28, 2024
1 parent 4e19bfb commit e08e4cd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@ jobs:
- name: Pre-Publish
run: npx nx run pre-publish

- name: Read version from package.json
id: get-version
run: echo "{version}={$(jq -r '.version' packages/core/package.json)}" >> $GITHUB_OUTPUT"
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@v1.3.1
with:
path: packages/core

- name: Commit release
uses: EndBug/add-and-commit@v9
with:
add: "['package-lock.json', 'CHANGELOG.md']"
message: ':bookmark: release: ${{ steps.get-version.outputs.version }}'
tag: 'v${{ steps.get-version.outputs.version }}'
message: ':bookmark: release: ${{ steps.package-version.outputs.current-version }}'
tag: 'v${{ steps.package-version.outputs.current-version }}'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -53,7 +55,7 @@ jobs:
type: now
from_branch: main
target_branch: latest
message: ':bookmark: release: ${{ steps.get-version.outputs.version }}'
message: ':bookmark: release: ${{ steps.package-version.outputs.current-version }}'
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish
Expand Down
36 changes: 22 additions & 14 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,44 @@ jobs:
run: echo "${{steps.set-version.outputs.version}}"

- name: Create comment
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ github.event.comment.id }}
edit-mode: replace
body: |
🚚 Snapshot `${{ steps.set-version.outputs.version }}` in progress... [Action](${{ steps.action-url.outputs.url }})
## 🚚 Snapshot
`${{ steps.set-version.outputs.version }}` in progress...
[Action](${{ steps.action-url.outputs.url }})
- uses: ./.github/workflows/actions/release-setup
with:
token: ${{ secrets.GITHUB_TOKEN }}
npm-token: ${{ secrets.NPM_PUBLISH_TOKEN }}

- name: Define version
run: npx nx release --git-commit=false --git-tag=false --preid=snapshot --specifier=${{steps.set-version.outputs.version}} --dry-run
run: npx nx release version --git-commit=false --git-tag=false --preid=snapshot --specifier=${{steps.set-version.outputs.version}}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build
run: npx nx run-many -t build --projects=tag:scope:release

- name: Pre-Publish
run: npx nx run pre-publish

- name: Publish
run: npx nx release publish --tag=snapshot

- name: Create comment
uses: peter-evans/create-or-update-comment@v3
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ github.event.comment.id }}
body: |
πŸš€ Snapshot `${{ steps.set-version.outputs.version }}` is published! [Action](${{ steps.action-url.outputs.url }})
# - name: Build
# run: npx nx run-many -t build --projects=tag:scope:release

# - name: Pre-Publish
# run: npx nx run pre-publish
## πŸš€ Snapshot
# - name: Publish
# run: npx nx release publish --tag=snapshot
`${{ steps.set-version.outputs.version }}` is published!
[Action](${{ steps.action-url.outputs.url }})
# - name: Git Reset
# run: git reset --hard
- name: Git Reset
run: git reset --hard

0 comments on commit e08e4cd

Please sign in to comment.