Skip to content

Commit

Permalink
update ci 23
Browse files Browse the repository at this point in the history
  • Loading branch information
hirsch88 committed Feb 28, 2024
1 parent 7003b60 commit ee7b31f
Showing 1 changed file with 61 additions and 53 deletions.
114 changes: 61 additions & 53 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,24 @@ jobs:
with:
path: packages/core

- name: Get current timestamp
id: timestamp
run: echo "timestamp=$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT
# - name: Get current timestamp
# id: timestamp
# run: echo "timestamp=$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT

# - name: Truncate timestamp to 8 characters
# id: truncated_timestamp
# run: echo "${{ steps.timestamp.outputs.timestamp}}"

- name: Get Last Commit SHA
id: last-commit
run: |
PR_NUMBER=${{ github.event.pull_request.number }}
COMMITS_URL="https://api.github.com/repos/${{ github.repository }}/pulls/${PR_NUMBER}}/commits"
LAST_COMMIT_SHA=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" $COMMITS_URL | jq -r '.[-1].sha')
echo "sha=$LAST_COMMIT_SHA" >> $GITHUB_OUTPUT
- name: Truncate timestamp to 8 characters
id: truncated_timestamp
run: echo "${{ steps.timestamp.outputs.timestamp}}"

- name: Sha commit
run: echo "${{ github.event.pull_request.head.sha }}"
run: echo "${{ steps.last-commit.outputs.sha}}"

- name: set version
id: set-version
Expand All @@ -56,48 +64,48 @@ jobs:
`${{ 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 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
if: success()
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 }}` is published!
[Action](${{ steps.action-url.outputs.url }})
- name: Create comment
if: failure()
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 }}` has failed!
[Action](${{ steps.action-url.outputs.url }})
- name: Git Reset
run: git reset --hard
# - uses: ./.github/workflows/actions/release-setup
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# npm-token: ${{ secrets.NPM_PUBLISH_TOKEN }}

# - name: Define version
# 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
# if: success()
# 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 }}` is published!
# [Action](${{ steps.action-url.outputs.url }})

# - name: Create comment
# if: failure()
# 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 }}` has failed!
# [Action](${{ steps.action-url.outputs.url }})

# - name: Git Reset
# run: git reset --hard

0 comments on commit ee7b31f

Please sign in to comment.