Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

tag.yml 1.1 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
  1. name: tag
  2. on:
  3. push:
  4. branches:
  5. - main
  6. paths:
  7. - 'package.json'
  8. workflow_dispatch:
  9. permissions:
  10. contents: write
  11. concurrency:
  12. group: ${{ github.workflow }}
  13. jobs:
  14. tag:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - uses: actions/checkout@v4
  18. - name: Use Node
  19. uses: actions/setup-node@v4
  20. with:
  21. node-version-file: '.nvmrc'
  22. cache: 'npm'
  23. - name: Get package version
  24. id: get_version
  25. run: |
  26. VERSION=$(node -p "require('./package.json').version")
  27. echo "VERSION=$VERSION" >> $GITHUB_ENV
  28. - name: Check if git tag exists
  29. id: check_tag
  30. run: |
  31. git fetch --tags
  32. VERSION=$(echo $VERSION)
  33. if [[ $(git tag -l $VERSION | wc -l) -eq '1' ]]; then
  34. echo "git tag already exists"
  35. echo "TAG=false" >> $GITHUB_ENV
  36. else
  37. echo "git tag does not exist"
  38. echo "TAG=true" >> $GITHUB_ENV
  39. fi
  40. - name: Create git tag
  41. if: env.TAG == 'true'
  42. run: git tag ${{ env.VERSION }}
  43. - name: Push git tag
  44. if: env.TAG == 'true'
  45. run: git push --tags
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...