📖
Internal Wiki
  • My Knowledge Wiki 🌿
  • ai
    • Prompts
  • beautiful
    • Beautiful websites
  • blog
    • best blog times
    • Good Blog Posts
  • career
    • First 90 Days
    • income streams
    • interview questions
    • Misc
    • Negotiation
    • On Call
  • coding
    • AWS
    • Bash
    • Browser Extensions
    • Cloudflare
    • CopyQ
    • Docker
    • Express
    • Filebase
    • Firebase
    • Git Commit Message Standards
    • GIT
    • Github Actions
    • html
    • TypeScript / JavaScript
    • JavaScript / TypeScript
    • NodeJS
    • npm
    • npx
    • Service Workers
    • Tunnel
    • Vite
    • Wrangler
    • New Angular Project
    • snippets
      • angular
        • Performance Tracking
        • Web3 in Angular Projects
      • nodejs
        • Dynamically load classes
  • communities
    • Communities
  • devex
    • Browser Experience
  • github
    • CI/CD
  • infra
    • Kubernetes
    • Windows
  • links
    • AI
    • Awesome lists
    • Beautify Code
    • cli
    • Code Snippet Images
    • Coding
    • Courses
    • Creators
    • Crypto
    • CSS
    • Design
    • Diagrams
    • Domains
    • events
    • Fonts
    • Funding
    • gifs
    • Github
    • I18N
    • Icons
    • Identity
    • Image (drawing, manipulation, ...)
    • All around infra (hosting, serverless, ...)
    • JSON utils
    • Libraries and Tools
    • Markdown
    • Machine Learning
    • Monetization
    • Music
    • No Code Tools
    • Node and NPM (and other package managers)
    • nostr
    • Other
    • Pitch
    • react
    • Resources
    • Resumes
    • SaaS
    • scraping
    • Screenshots
    • Search
    • SEO
    • Services
    • Social Media Engagement
    • Popular Stacks
    • Storage
    • Terms
    • Text to speech
    • Text Effects
    • Tutorials
    • video
    • Nice wasm libs
    • Writing
    • YouTube
  • linux-commands
    • convert
    • ffmpeg
    • General
    • Screen
  • Quotes
    • Twitter Quotes
  • reddit
    • Side projects
  • shops
    • Dog Stuff
    • wir-machen-druck
  • watch
    • Youtube Videos
  • wine
    • Wine
  • learning
    • house
      • Heating Energy Act
    • sbf
      • SBF Navi
      • SBF Praxis
      • SBF
Powered by GitBook
On this page
  1. coding

Github Actions

Tag and Publish to npm/private registry

name: Tag and publish a new version

on:
  release:
    types: [published]

jobs:
  tag-and-publish:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - name: Setup Node
        uses: actions/setup-node@v3
        with:
          node-version: 19
          cache: "yarn"
      - name: Install
        run: yarn install --frozen-lockfile
      - name: Build
        run: yarn build
      - name: Set output
        run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
      - name: Set version
        run: |
          git config user.name 'github-actions[bot]'
          git config user.email 'github-actions[bot]@users.noreply.github.com'
          npm version ${{ env.RELEASE_VERSION }} --git-tag-version false
          git add .
          git commit -m "chore: Publish v${{ env.RELEASE_VERSION }}"
      - name: Publish to NPM
        run: |
          echo "//registry.npmjs.org/:_authToken=${{ env.NPM_TOKEN }}" >> .npmrc
          npm publish --access=public
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
      - name: Push changes
        run: git push origin HEAD:main
PreviousGITNexthtml

Last updated 2 years ago