Compare commits

...

7 Commits

Author SHA1 Message Date
Ferenc Hammerl 0d44da2b87 Raw jq for actual version
Tag test / publish (push) Has been cancelled
Tag test / test (push) Has been cancelled
Tag test / Tag ${{ needs.test.outputs.sha }} with ${{ needs.test.outputs.tag }} (push) Has been cancelled
2023-03-07 11:11:44 +00:00
Ferenc Hammerl cb86beb23a BEtter tag format 2023-03-07 11:05:52 +00:00
Ferenc Hammerl 7edb0957cc Fix indentation 2023-03-07 10:51:42 +00:00
Ferenc Hammerl b92588fa7f Use constants and push for tag-test
Fix typo in releases.yml
2023-03-07 10:49:25 +00:00
Ferenc Hammerl 39e91a437a Fix indent 2023-03-07 10:44:40 +00:00
Ferenc Hammerl 4166af5b3e Fix typo 2023-03-07 10:43:17 +00:00
Ferenc Hammerl b8bef557c0 Tag commits on NPM releases with pkgname-v.x.y.z 2023-03-07 10:41:27 +00:00
2 changed files with 75 additions and 1 deletions
+29 -1
View File
@@ -9,11 +9,17 @@ on:
jobs:
test:
outputs:
sha: ${{ steps.commit.outputs.sha }}
tag: ${{ steps.tag.outputs.tag }}
runs-on: macos-latest
steps:
- name: setup repo
uses: actions/checkout@v3
- id: commit
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- id: tag
run: echo "tag=@actions/${{ github.event.inputs.package }}@$(cat packages/${{ github.event.inputs.package }}/package.json | jq -r .version" >> "$GITHUB_OUTPUT"
- name: verify package exists
run: ls packages/${{ github.event.inputs.package }}
@@ -77,4 +83,26 @@ jobs:
curl -X POST -H 'Content-type: application/json' --data '{"text":":dance: Successfully published a new version of ${{ github.event.inputs.package }}"}' $SLACK_WEBHOOK
env:
SLACK_WEBHOOK: ${{ secrets.SLACK }}
tag:
name: "Tag ${{ needs.test.outputs.sha }} with ${{ needs.test.outputs.tag }}"
runs-on: "macos-latest"
needs: [test, publish]
steps:
- uses: actions/checkout@v3
- name: Create tag
uses: actions/github-script@v6
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ needs.test.outputs.tag }}',
sha: '${{ needs.test.outputs.sha }}'
})
- name: notify slack on failure
if: failure()
run: |
curl -X POST -H 'Content-type: application/json' --data '{"text":":pb__failed: Publish of ${{ github.event.inputs.package }} was successful, but failed to tag commit ${{ needs.test.outputs.sha }} with version ${{ needs.test.outputs.tag }}"}' $SLACK_WEBHOOK
env:
SLACK_WEBHOOK: ${{ secrets.SLACK }}
+46
View File
@@ -0,0 +1,46 @@
name: Tag test
on: push
jobs:
test:
outputs:
sha: ${{ steps.commit.outputs.sha }}
tag: ${{ steps.tag.outputs.tag }}
runs-on: macos-latest
steps:
- name: setup repo
uses: actions/checkout@v3
- id: commit
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- id: tag
run: echo "tag=@actions/http-client@$(cat packages/http-client/package.json | jq -r .version)-test-tag" >> "$GITHUB_OUTPUT"
publish:
runs-on: macos-latest
needs: test
steps:
- name: skip publish
run: echo "skip publish"
tag:
name: "Tag ${{ needs.test.outputs.sha }} with ${{ needs.test.outputs.tag }}"
runs-on: "macos-latest"
needs: [test, publish]
steps:
- uses: actions/checkout@v3
- name: Create tag
uses: actions/github-script@v6
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ needs.test.outputs.tag }}',
sha: '${{ needs.test.outputs.sha }}'
})
# - name: notify slack on failure
# if: failure()
# run: |
# curl -X POST -H 'Content-type: application/json' --data '{"text":":pb__failed: Publish of ${{ github.event.inputs.package }} was successful, but failed to tag commit ${{ needs.test.outputs.sha }} with version ${{ needs.test.outputs.tag }}"}' $SLACK_WEBHOOK
# env:
# SLACK_WEBHOOK: ${{ secrets.SLACK }}