<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Vitor Águila</title>
    <description>The latest articles on Forem by Vitor Águila (@vitoraguila).</description>
    <link>https://forem.com/vitoraguila</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1172937%2F1f1ead27-09a8-46d0-b935-71030411485c.jpeg</url>
      <title>Forem: Vitor Águila</title>
      <link>https://forem.com/vitoraguila</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/vitoraguila"/>
    <language>en</language>
    <item>
      <title>How to create a GitHub Packages for typescript projects</title>
      <dc:creator>Vitor Águila</dc:creator>
      <pubDate>Fri, 29 Sep 2023 08:46:19 +0000</pubDate>
      <link>https://forem.com/vitoraguila/how-to-create-a-github-packages-for-typescript-projectsg-2d7g</link>
      <guid>https://forem.com/vitoraguila/how-to-create-a-github-packages-for-typescript-projectsg-2d7g</guid>
      <description>&lt;p&gt;🌟 &lt;strong&gt;What’s the Buzz About GitHub npm Packages?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the grand universe of code, GitHub Packages is like your friendly neighborhood supermarket, but for code packages! 🏪 It's where your code’s grocery list finds everything it needs - all neatly shelved under one big GitHub roof. It’s your one-stop-shop for hosting and managing packages, bringing together your source code and dependencies, and making sure only the folks you want can access them. 🛒 And the billing? All tied up in a neat bow within GitHub, keeping your software development sleek and centralized. It's the superhero your code didn’t know it needed! 🦸‍♂️&lt;/p&gt;

&lt;p&gt;🚀 &lt;strong&gt;Ready to Start a New Project Adventure? Follow Me!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1 - &lt;strong&gt;Summon Your Terminal:&lt;/strong&gt; Pop open your terminal - think of it as opening the doors to your coding kingdom. 👑&lt;br&gt;
2 - &lt;strong&gt;Create a New Kingdom:&lt;/strong&gt; Now, let’s carve out a new land for your project. You can create a new folder (I named mine &lt;code&gt;github-package-example&lt;/code&gt;, feel free to get creative! 🎨) with a simple command, and crown it as the new realm of your code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir github-package-example
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3 - &lt;strong&gt;Initiate the Magic of npm:&lt;/strong&gt; Inside your new kingdom, initiate the npm with the sacred &lt;code&gt;npm init&lt;/code&gt; command. It's like casting a spell to summon the npm spirits to prepare your land for coding greatness! 🧙‍♂️&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd github-package-example
npm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4 - &lt;strong&gt;A Path of Questions:&lt;/strong&gt; The npm spirits will now ask you a series of questions about your project. Fear not! You can bravely press enter for all options. (Worry not about the details for now; we’ll shape and chisel them in the next steps.) 🗿&lt;/p&gt;

&lt;p&gt;5 - 🌐 &lt;strong&gt;Next Step, Forge a GitHub Repository:&lt;/strong&gt;&lt;br&gt;
Embark on a new adventure by creating your own GitHub Repository. It’s like crafting a treasure chest where you’ll keep all your precious code gems. Navigate to &lt;a href="https://github.com/" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;, click the '+' on the upper-right corner and choose ‘New repository’. Give it a worthy name and bring it to life!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7rgq4f10u7jh3rneuboo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7rgq4f10u7jh3rneuboo.png" alt="Image description" width="694" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;6 - 🛡️ &lt;strong&gt;Connect Your Local Realm to the Remote Kingdom:&lt;/strong&gt;&lt;br&gt;
It's time to build a magical bridge between your local project and your newfound GitHub Repository! Copy the remote URL from your repository on GitHub. Head back to your terminal in the directory of your project and paste the commands to connect the two realms together.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote add origin YOUR_REMOTE_URL
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuozn8smzdwd2frju6ei4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuozn8smzdwd2frju6ei4.png" alt="Image description" width="704" height="558"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;7 - 🌟 &lt;strong&gt;Initialize Your GitHub Kingdom:&lt;/strong&gt;&lt;br&gt;
Inside your project folder, initiate GitHub by entering the command below. It's like laying the cornerstone for your GitHub kingdom right in your local project!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8 - 📜 &lt;strong&gt;Update Your Treasure Map (&lt;code&gt;package.json&lt;/code&gt;):&lt;/strong&gt;&lt;br&gt;
Now, let’s make sure everyone knows where your treasure (code) lies! Update your &lt;code&gt;package.json&lt;/code&gt; by adding the repository info. It’s like marking your treasure on a map, guiding fellow adventurers to your project’s repository on GitHub!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"repository": {
  "type": "git",
  "url": "git+https://github.com/your-username/github-package-example.git"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And lo! Your local project is now in sync with your GitHub Repository, a beacon shining brightly in the GitHub universe, calling out to fellow coders and adventurers! 🌌 &lt;/p&gt;

&lt;p&gt;9 - 📚 &lt;strong&gt;Install TypeScript:&lt;/strong&gt;&lt;br&gt;
Before you embark further, arm yourself with TypeScript! It's like learning an ancient language to cast more powerful code spells. In your terminal, within your project directory, run the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add typescript -D
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;10 - 🛠️ &lt;strong&gt;Install the Tsup Toolkit:&lt;/strong&gt;&lt;br&gt;
Next, equip yourself with &lt;code&gt;tsup&lt;/code&gt;, a mighty tool for building your library. In the realm of your terminal, unleash the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add tsup -D
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;11 - 🧙‍♂️ &lt;strong&gt;Update the &lt;code&gt;package.json&lt;/code&gt; Scroll:&lt;/strong&gt;&lt;br&gt;
Time to update your magical scroll, &lt;code&gt;package.json&lt;/code&gt;. It's like drawing a new rune to enhance your project's power. Remember to add your organization or user in the name property to ensure your package's successful journey in the world.&lt;/p&gt;

&lt;p&gt;Here's a tip from a fellow adventurer: if you're not part of any organization, use your username as a prefix. For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"name": "@vitoraguila/github-package-example",
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The packege.json will be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
  "name": "@vitoraguila/github-package-example",
  "version": "1.0.0",
  "description": "",
  "main": "./dist/index.cjs",
  "module": "./dist/index.js",
  "types": "./dist/index.d.ts",
  "type": "module",
  "scripts": {
    "build": "npx tsup --dts"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/vitoraguila/github-package-example.git"
  },
  "author": "",
  "license": "ISC"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s explain&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;"main"&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; The entry point file for your project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What it means:&lt;/strong&gt; When others use your project as a module, it will load from the &lt;strong&gt;&lt;code&gt;./dist/index.cjs&lt;/code&gt;&lt;/strong&gt; file.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;"module"&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; Specifies the file that should be used as the module entry point.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What it means:&lt;/strong&gt; This field is used by tools that work with ES modules, and it points to &lt;strong&gt;&lt;code&gt;./dist/index.js&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;"types"&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; The path to the type definitions for this project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What it means:&lt;/strong&gt; If your project is written in TypeScript, this field points to the file (&lt;strong&gt;&lt;code&gt;./dist/index.d.ts&lt;/code&gt;&lt;/strong&gt;) containing the type definitions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;"type"&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; Specifies the type of the module.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What it means:&lt;/strong&gt; This project is an ES module, so you can use import and export syntax in your JavaScript files.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;"scripts"&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; A script to build your project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What it means:&lt;/strong&gt; By running &lt;strong&gt;&lt;code&gt;yarn build&lt;/code&gt;&lt;/strong&gt;, it will execute &lt;strong&gt;&lt;code&gt;npx tsup --dts&lt;/code&gt;&lt;/strong&gt;, which builds your project and generates type definitions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;"repository"&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; Information about the project repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What it means:&lt;/strong&gt; The code for this project is stored in a git repository located at the given URL.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;if you need to generate the declaration typescript files please add &lt;code&gt;--dts&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;to the command &lt;code&gt;build&lt;/code&gt; being &lt;code&gt;npx tsup --dts&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;12 - 📜 &lt;strong&gt;Craft a &lt;code&gt;.gitignore&lt;/code&gt; :&lt;/strong&gt;&lt;br&gt;
Create a &lt;code&gt;.gitignore&lt;/code&gt; scroll in your project’s realm. It's like setting up a magical barrier that keeps unnecessary files from entering your repository's sacred grounds.&lt;/p&gt;

&lt;p&gt;In the terminal, conjure the scroll with a touch of a command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch .gitignore
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, write down the names of the files or directories you wish to guard against, like the &lt;code&gt;node_modules/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;13 - 🧙‍♂️ &lt;strong&gt;Forge Your &lt;code&gt;tsup.config.ts&lt;/code&gt;:&lt;/strong&gt;&lt;br&gt;
Now, craft a &lt;code&gt;tsup.config.ts&lt;/code&gt; in your project directory. It’s like inscribing a powerful spell to guide the building of your project. Use it to hold your &lt;code&gt;tsup&lt;/code&gt; configuration and make your building process a breeze.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// tsup.config.ts
import "dotenv/config";
import { defineConfig } from "tsup";

export default defineConfig({
  entry: {
    index: "src/index.ts",
  },
  external: [],
  format: ["esm", "cjs"],
  esbuildPlugins: [],
  dts: "src/index.ts",
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside the &lt;strong&gt;&lt;code&gt;defineConfig&lt;/code&gt;&lt;/strong&gt; function, several configuration options are defined:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;entry: { index: "src/index.ts" }&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; Entry point for the project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What it means:&lt;/strong&gt; It tells &lt;strong&gt;&lt;code&gt;tsup&lt;/code&gt;&lt;/strong&gt; that &lt;strong&gt;&lt;code&gt;src/index.ts&lt;/code&gt;&lt;/strong&gt; is the entry file for the project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;external: []&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; An array of external modules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What it means:&lt;/strong&gt; It is used to specify modules that should remain external to the bundle. Currently, it's an empty array, so no modules are marked as external.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;format: ["esm", "cjs"]&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; Output formats.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What it means:&lt;/strong&gt; &lt;strong&gt;&lt;code&gt;tsup&lt;/code&gt;&lt;/strong&gt; will bundle the project into both ES module (&lt;strong&gt;&lt;code&gt;esm&lt;/code&gt;&lt;/strong&gt;) and CommonJS (&lt;strong&gt;&lt;code&gt;cjs&lt;/code&gt;&lt;/strong&gt;) formats.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;esbuildPlugins: []&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; An array of ESBuild plugins.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What it means:&lt;/strong&gt; Allows you to use ESBuild plugins in the bundling process. Currently, no plugins are being used as it's an empty array.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;&lt;code&gt;dts: "src/index.ts"&lt;/code&gt;&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;What it is:&lt;/strong&gt; Generation of declaration file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What it means:&lt;/strong&gt; Tells &lt;strong&gt;&lt;code&gt;tsup&lt;/code&gt;&lt;/strong&gt; to generate a declaration file (&lt;strong&gt;&lt;code&gt;d.ts&lt;/code&gt;&lt;/strong&gt;) based on the &lt;strong&gt;&lt;code&gt;src/index.ts&lt;/code&gt;&lt;/strong&gt; file, which includes type definitions for the project.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This breakdown provides an understanding of each section of the &lt;strong&gt;&lt;code&gt;tsup.config&lt;/code&gt;&lt;/strong&gt; file, helping readers to know what each part does and how it contributes to the configuration of the TypeScript bundling process with &lt;strong&gt;&lt;code&gt;tsup&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;14 - 🌟 &lt;strong&gt;Equip Additional Magical Artifacts:&lt;/strong&gt;&lt;br&gt;
For additional capabilities like using environment variables or styling with SCSS/SASS, you may need to call upon extra libraries or plugins. It's like seeking the aid of mythical creatures for your journey!&lt;/p&gt;

&lt;p&gt;Even though we won't dive deep into the enchanted forests of environment variables in this tutorial, a trusted companion would be the &lt;code&gt;dotenv&lt;/code&gt; library for managing environment variables.&lt;/p&gt;

&lt;p&gt;To enlist its aid, summon it with the following incantation:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add dotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And Lo! Your project now stands tall, armored with a &lt;code&gt;.gitignore&lt;/code&gt; scroll, empowered by a &lt;code&gt;tsup.config.ts&lt;/code&gt;, and ready to call upon additional allies for further enhancement! The path ahead is bright and clear, venture forth into the realms of coding with courage and joy! 🌟 #OnwardAndUpward&lt;/p&gt;

&lt;p&gt;15 - 📁 &lt;strong&gt;Crafting the Source File:&lt;/strong&gt;&lt;br&gt;
In the sacred &lt;code&gt;source&lt;/code&gt; folder, create a file to export a simple sum function. This humble beginning will serve as an example to illuminate the path of library creation. Just imagine, a single incantation capable of summing two numbers! 🧮&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// src/index.ts
export const sum = (a: number, b: number) =&amp;gt; a + b;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;16 - 🏃‍♂️ &lt;strong&gt;Embark on the Run:&lt;/strong&gt;&lt;br&gt;
Now, valiant coder, you are primed to set your creation into motion. With a flourish of a command, breathe life into your project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmgjy1iuv9yxnviv7spm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmmgjy1iuv9yxnviv7spm.png" alt="Image description" width="550" height="272"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7pqc8lzzdzgjq9ztw097.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7pqc8lzzdzgjq9ztw097.png" alt="Image description" width="294" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;17 - 🏰 &lt;strong&gt;Behold Your Creation:&lt;/strong&gt;&lt;br&gt;
Upon running, a new dominion named &lt;code&gt;/dist&lt;/code&gt; shall emerge in your project’s kingdom. Within its walls, you will find the artifacts of your creation, the generated files standing tall and resolute, ready to embark on adventures across the realm of code. 🗺️&lt;/p&gt;

&lt;p&gt;📜 &lt;strong&gt;Glimpse into the Future:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;As this chapter of the tome closes, fear not! In the forthcoming verses, prepare yourself to traverse the paths of publishing your noble package. Arm yourself with the might of GitHub Actions to build sturdy pipelines, ensuring your project’s enduring legacy in the annals of code! 🏹&lt;/p&gt;


&lt;h1&gt;
  
  
  GitHub Workflows
&lt;/h1&gt;

&lt;p&gt;1 - 📂 &lt;strong&gt;Create a Home for GitHub Workflows:&lt;/strong&gt;&lt;br&gt;
Unveil the gates to automation by manifesting a new bastion within your kingdom! Within your project’s realm, conjure forth a directory named &lt;code&gt;.github/workflows/&lt;/code&gt;. This fortress shall safeguard the blueprints of your automated tasks and workflows, guarding the order within your code kingdom. 🏰&lt;br&gt;
2 - 📜 &lt;strong&gt;Craft the Scrolls of Automation:&lt;/strong&gt;&lt;br&gt;
Within this stronghold, breathe life into two sacred scrolls:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;master-release.yaml&lt;/code&gt;: This scroll shall heed the call whenever a pull request merges into the master branch. It shall inscribe a new release, bestowing a tag upon the merged changes and preparing the ground for a bountiful harvest of updates. 🌱&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;publish.yaml&lt;/code&gt;: This mighty scroll shall awaken upon the publication of a release. It shall brandish the powers of build and publish, propelling your package into the grand library of npm, ready to be summoned by other code-wielders across the realms. 📚
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# .github/workflows/master-release.yaml

name: Create Release

on:
  pull_request:
    types:
      - closed
    branches:
      - master

jobs:
  release:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Get latest release details
      run: |
        RECENT_RELEASES_ARRAY=$(curl -qsSL \
          -H "Accept: application/vnd.github+json" \
          -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
          -H "X-GitHub-Api-Version: 2022-11-28" \
          "${{ github.api_url }}/repos/${{ github.repository }}/releases")

        RECENT_RELEASE=$(echo "$RECENT_RELEASES_ARRAY" | jq '.[0]')

        IS_DRAFT=$(echo "$RECENT_RELEASE" | jq -r '.prerelease')
        echo "IS_PRE_RELEASE=$(echo "$RECENT_RELEASE" | jq -r '.prerelease')" &amp;gt;&amp;gt; $GITHUB_ENV
        echo "IS_DRAFT=$IS_DRAFT" &amp;gt;&amp;gt; $GITHUB_ENV
        echo "TAG_NAME=$(echo "$RECENT_RELEASE" | jq -r '.tag_name')" &amp;gt;&amp;gt; $GITHUB_ENV

        if [[ "$IS_DRAFT" == "true" ]]; then
          echo "The most recent release is a draft. Skipping tag/release creation."
          echo "SKIP=true" &amp;gt;&amp;gt; $GITHUB_ENV
        else
          echo "Proceeding with tag/release creation."
          echo "SKIP=false" &amp;gt;&amp;gt; $GITHUB_ENV
        fi    

    - name: Create new tag
      id: newtag
      if: env.SKIP != 'true'
      env:
        GH_TOKEN: ${{ github.token }}
      run: |
        LABELS=$(gh api repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} --jq '.labels.[].name')
        echo ${{ env.TAG_NAME }}

        # If there's no latest release (meaning it's the first release)
        if [[ -z "${{ env.TAG_NAME }}" ]] || [[ "${{ env.TAG_NAME }}" == "null" ]]; then
          NEW_TAG="v1.1.0"
          TYPE="MINOR"
          echo "type=$TYPE" &amp;gt;&amp;gt; $GITHUB_OUTPUT
          echo "tag=$NEW_TAG" &amp;gt;&amp;gt; $GITHUB_OUTPUT
          exit 0
        fi

        # Check if the latest release was a draft or pre-release
        if [[ "${{ env.IS_DRAFT }}" == "true" || "${{ env.IS_PRE_RELEASE }}" == "true" ]]; then
          echo "Latest release was a draft or pre-release. Skipping."
          exit 0
        fi

        CURRENT_TAG=${{ env.TAG_NAME }}
        IFS='.' read -ra VERSION &amp;lt;&amp;lt;&amp;lt; "$(echo $CURRENT_TAG | tr -d 'v')"

        MAJOR=${VERSION[0]}
        MINOR=${VERSION[1]}
        PATCH=${VERSION[2]}

        TYPE="PATCH"

        for LABEL in "${LABELS[@]}"; do 
          if [[ "$LABEL" == "major" ]]; then
            MAJOR=$((MAJOR + 1))
            MINOR=0
            PATCH=0
            TYPE="MAJOR"
            break
          elif [[ "$LABEL" == "minor" ]]; then
            MINOR=$((MINOR + 1))
            PATCH=0
            TYPE="MINOR"
            break
          fi
        done

        if [[ "$TYPE" == "PATCH" ]]; then
            PATCH=$((PATCH + 1))
        fi

        NEW_TAG="v$MAJOR.$MINOR.$PATCH"

        echo "type=$TYPE" &amp;gt;&amp;gt; $GITHUB_OUTPUT
        echo "tag=$NEW_TAG" &amp;gt;&amp;gt; $GITHUB_OUTPUT

    - name: Create GitHub Release
      if: steps.newtag.outputs.tag
      uses: actions/create-release@v1
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
        tag_name: ${{ steps.newtag.outputs.tag }}
        release_name: "[${{ steps.newtag.outputs.type }}] Release ${{ steps.newtag.outputs.tag }}"
        draft: true
        prerelease: true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;When Does the Workflow Run?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The GitHub Actions workflow outlined is designed to automatically create a new release when certain conditions are met. Here are the details regarding the circumstances under which the workflow is triggered and runs:&lt;/p&gt;
&lt;h3&gt;
  
  
  Trigger Points
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Event Type: Pull Request Closure&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The workflow is activated when a pull request (PR) is closed. It listens for the &lt;strong&gt;&lt;code&gt;closed&lt;/code&gt;&lt;/strong&gt; event type under the &lt;strong&gt;&lt;code&gt;pull_request&lt;/code&gt;&lt;/strong&gt; event category.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;on:&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pull_request:
  types:
    - closed
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Specific Branch: Master&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The closed PR must be targeted to the &lt;strong&gt;&lt;code&gt;master&lt;/code&gt;&lt;/strong&gt; branch. The workflow does not trigger for PRs closed on other branches.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;branches:&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;branches:
  - master
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;h3&gt;
  
  
  Jobs
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The workflow comprises a single job named &lt;strong&gt;&lt;code&gt;release&lt;/code&gt;&lt;/strong&gt;. This job is responsible for the entire process of fetching the latest release details, creating a new tag, and creating a GitHub release.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Conditional Steps within the Job
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Fetching the Latest Release Details&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Unconditionally, it fetches the most recent release's details to check whether it's a draft and the tag name.&lt;/li&gt;
&lt;li&gt;If the latest release is a draft, a &lt;strong&gt;&lt;code&gt;SKIP&lt;/code&gt;&lt;/strong&gt; environment variable is set to &lt;strong&gt;&lt;code&gt;true&lt;/code&gt;&lt;/strong&gt;, halting the further steps.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Creating a New Tag&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;This step is conditional: it will only execute if &lt;strong&gt;&lt;code&gt;SKIP&lt;/code&gt;&lt;/strong&gt; is not &lt;strong&gt;&lt;code&gt;true&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;It fetches the labels of the closed PR and calculates the new tag based on the current tag and the labels (which indicate whether it's a major, minor, or patch release).&lt;/li&gt;
&lt;li&gt;It sets the new tag and type in the outputs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Creating a GitHub Release&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;This step is also conditional: it only runs if a new tag is successfully created in the previous step.&lt;/li&gt;
&lt;li&gt;It creates a new GitHub release with the new tag and marks it as a draft and pre-release.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;When Does the Workflow Not Run?&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;For PRs on Other Branches&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;The workflow will not trigger for PRs that are closed on branches other than &lt;strong&gt;&lt;code&gt;master&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When the Latest Release is a Draft&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;If the most recent release is a draft, the &lt;strong&gt;&lt;code&gt;SKIP&lt;/code&gt;&lt;/strong&gt; variable is set to &lt;strong&gt;&lt;code&gt;true&lt;/code&gt;&lt;/strong&gt;, and the subsequent steps (creating a new tag and GitHub release) are not executed.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In essence, this GitHub Actions workflow is specifically tailored to run when a PR is closed on the &lt;strong&gt;&lt;code&gt;master&lt;/code&gt;&lt;/strong&gt; branch. It then checks the details of the latest release, and based on the condition whether the latest release is a draft or not, it either proceeds to create a new tag and GitHub release or skips these steps. This automation ensures streamlined and consistent release creation, aiding in efficient project management and version control.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Version Bumping Logic in GitHub Actions Workflow&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In the GitHub Actions workflow described, an important step is the automatic version bumping. The version number follows a typical semantic versioning pattern: major.minor.patch (for example, v1.2.3).&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Initial Assumptions&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;If there’s no previous release, it starts with a default version of v1.1.0.&lt;/li&gt;
&lt;li&gt;It assumes a patch release unless indicated otherwise.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fetching the Current Tag&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;The script fetches the latest release tag from the GitHub API, which is stored in &lt;strong&gt;&lt;code&gt;CURRENT_TAG&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Extracting Version Numbers&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;The major, minor, and patch numbers are extracted from &lt;strong&gt;&lt;code&gt;CURRENT_TAG&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Checking Labels for Version Bump Type&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;The script then checks the labels on the closed pull request.

&lt;ul&gt;
&lt;li&gt;If it finds a &lt;strong&gt;&lt;code&gt;major&lt;/code&gt;&lt;/strong&gt; label, it increments the major version and resets minor and patch versions to 0.&lt;/li&gt;
&lt;li&gt;If it finds a &lt;strong&gt;&lt;code&gt;minor&lt;/code&gt;&lt;/strong&gt; label, it increments the minor version and resets the patch version to 0.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Default to Patch Version Bump&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;If no &lt;strong&gt;&lt;code&gt;major&lt;/code&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;code&gt;minor&lt;/code&gt;&lt;/strong&gt; labels are found, it defaults to a patch version bump, incrementing only the patch version number.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here’s the breakdown of the version bumping logic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;bashCopy code
# Extract the current version numbers
MAJOR=${VERSION[0]}
MINOR=${VERSION[1]}
PATCH=${VERSION[2]}

# Assume a patch release by default
TYPE="PATCH"

# Iterate through the labels
for LABEL in "${LABELS[@]}"; do
  # If the label is "major"
  if [[ "$LABEL" == "major" ]]; then
    # Increment the major version, reset minor and patch to 0
    MAJOR=$((MAJOR + 1))
    MINOR=0
    PATCH=0
    TYPE="MAJOR"
    break
  # Else, if the label is "minor"
  elif [[ "$LABEL" == "minor" ]]; then
    # Increment the minor version, reset patch to 0
    MINOR=$((MINOR + 1))
    PATCH=0
    TYPE="MINOR"
    break
  fi
done

# If it’s still a patch release
if [[ "$TYPE" == "PATCH" ]]; then
    # Increment the patch version
    PATCH=$((PATCH + 1))
fi

# Construct the new tag
NEW_TAG="v$MAJOR.$MINOR.$PATCH"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;In this part of the script, the version number is automatically bumped based on the labels on the pull request. Labeling a pull request with &lt;strong&gt;&lt;code&gt;major&lt;/code&gt;&lt;/strong&gt; or &lt;strong&gt;&lt;code&gt;minor&lt;/code&gt;&lt;/strong&gt; will influence the versioning logic, ensuring the new release tag reflects the type of changes introduced. This approach automates the versioning process, saving time and reducing the potential for human error in version numbering.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Publish workflow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# .github/workflows/publish.yaml

name: build

on:
  release:
    types: [published]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3

      - name: Set env
        env:
          GH_TOKEN: ${{ github.token }}
        run: |
          echo "RELEASE_VERSION=$(gh release list --repo https://github.com/${{ github.repository }} --limit 3 | grep -o 'v.*' | sort -r | awk 'NR==1  {print $3}' | sed 's/^v//g; s/[^0-9\.]//g')" &amp;gt;&amp;gt; $GITHUB_ENV

      - name: Debug
        run: |
          echo "Release version: ${{env.RELEASE_VERSION}}"

      - name: Setup Node
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
          registry-url: 'https://npm.pkg.github.com'
          scope: '@vitoraguila'

      - name: Create release branch 
        run: |
          git checkout -b release/${{env.RELEASE_VERSION}}

      - name: Install dependencies
        run: yarn &amp;amp;&amp;amp; yarn install

      - name: Build
        run: yarn build

      - name: Patch version
        run: |
          git config --global user.name ${GITHUB_ACTOR}
          git config --global user.email "github-actions@github.com"
          git remote add publisher "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"

          echo "Release version: ${{env.RELEASE_VERSION}}"

          yarn config set version-git-tag false
          yarn version --new-version ${{env.RELEASE_VERSION}}

          git commit package.json -m "Updated package.json version to version released ${{env.RELEASE_VERSION}}"
          git push publisher HEAD:release/v${{env.RELEASE_VERSION}}

      - name: Publish
        run: yarn publish
        env:
          NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;When Does the Workflow Run?&lt;/strong&gt;
&lt;/h3&gt;

&lt;h3&gt;
  
  
  Trigger Points
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Event Type: Release Publication&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The workflow is activated when a release is published.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;on:&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;release&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;types&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;published&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Steps within the Workflow&lt;/strong&gt;
&lt;/h3&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Checkout&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Uses the &lt;strong&gt;&lt;code&gt;actions/checkout@v3&lt;/code&gt;&lt;/strong&gt; action to checkout the repository code to the runner, allowing the workflow to access the repository content.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. &lt;strong&gt;Set Environment Variables&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Uses the GitHub CLI to fetch the latest release version from the repository and sets it as an environment variable &lt;strong&gt;&lt;code&gt;RELEASE_VERSION&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;This version is used in subsequent steps for creating a release branch and patching the version.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. &lt;strong&gt;Debug&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Echoes the release version to the log for debugging purposes, ensuring that the &lt;strong&gt;&lt;code&gt;RELEASE_VERSION&lt;/code&gt;&lt;/strong&gt; is set correctly.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. &lt;strong&gt;Setup Node&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sets up the Node.js environment using &lt;strong&gt;&lt;code&gt;actions/setup-node@v3&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Specifies Node version &lt;strong&gt;&lt;code&gt;16.x&lt;/code&gt;&lt;/strong&gt; and configures the npm registry URL and scope for GitHub Packages.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. &lt;strong&gt;Create Release Branch&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Checks out a new branch named &lt;strong&gt;&lt;code&gt;release/${RELEASE_VERSION}&lt;/code&gt;&lt;/strong&gt;, where &lt;strong&gt;&lt;code&gt;${RELEASE_VERSION}&lt;/code&gt;&lt;/strong&gt; is the version number fetched earlier.&lt;/li&gt;
&lt;li&gt;This branch is used for making changes to &lt;strong&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/strong&gt; and pushing the updated version back to the repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. &lt;strong&gt;Install Dependencies&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Installs project dependencies using Yarn to ensure that the project can be built successfully.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  7. &lt;strong&gt;Build&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Executes the &lt;strong&gt;&lt;code&gt;yarn build&lt;/code&gt;&lt;/strong&gt; command to build the project.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  8. &lt;strong&gt;Patch Version&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Configures &lt;strong&gt;&lt;code&gt;git&lt;/code&gt;&lt;/strong&gt; with the GitHub actor's name and email.&lt;/li&gt;
&lt;li&gt;Adds a new remote named &lt;strong&gt;&lt;code&gt;publisher&lt;/code&gt;&lt;/strong&gt; to &lt;strong&gt;&lt;code&gt;git&lt;/code&gt;&lt;/strong&gt;, which is used for pushing changes to the repository.&lt;/li&gt;
&lt;li&gt;Updates the version in &lt;strong&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/strong&gt; to the release version and commits the changes to the newly created release branch.&lt;/li&gt;
&lt;li&gt;Pushes the changes to the &lt;strong&gt;&lt;code&gt;release/v${RELEASE_VERSION}&lt;/code&gt;&lt;/strong&gt; branch in the repository.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  9. &lt;strong&gt;Publish&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Publishes the package using &lt;strong&gt;&lt;code&gt;yarn publish&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Uses a GitHub token for authentication when publishing the package.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;When Does the Workflow Not Run?&lt;/strong&gt;
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The workflow will not trigger for other types of release events such as &lt;strong&gt;&lt;code&gt;created&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;edited&lt;/code&gt;&lt;/strong&gt;, or &lt;strong&gt;&lt;code&gt;deleted&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;It only runs when a release is &lt;strong&gt;&lt;code&gt;published&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In essence, the &lt;strong&gt;&lt;code&gt;build&lt;/code&gt;&lt;/strong&gt; workflow is a comprehensive automated process for handling the release cycle after a release is published. It efficiently manages the tasks of setting up the environment, creating a release branch, building the project, patching the version, and publishing the package, ensuring a smooth and consistent release process.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;1. Set env Step&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In the “Set env” step, the goal is to determine the version number of the most recent release and assign it to an environment variable. Here is the breakdown:&lt;/p&gt;

&lt;h3&gt;
  
  
  Logic:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The GitHub CLI (&lt;strong&gt;&lt;code&gt;gh&lt;/code&gt;&lt;/strong&gt;) is used to fetch the list of releases for the repository.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;&lt;code&gt;grep&lt;/code&gt;&lt;/strong&gt; command is used to find the version number, which is expected to be in a format starting with 'v' (for example, &lt;strong&gt;&lt;code&gt;v1.2.3&lt;/code&gt;&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;&lt;code&gt;awk&lt;/code&gt;&lt;/strong&gt; command fetches the third column, which is the version number.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;&lt;code&gt;sed&lt;/code&gt;&lt;/strong&gt; command is used to remove the 'v' prefix and any non-numeric or non-dot characters, leaving only the numeric version (for example, &lt;strong&gt;&lt;code&gt;1.2.3&lt;/code&gt;&lt;/strong&gt;).&lt;/li&gt;
&lt;li&gt;This version number is then echoed as &lt;strong&gt;&lt;code&gt;RELEASE_VERSION&lt;/code&gt;&lt;/strong&gt; into the GitHub environment variable file (&lt;strong&gt;&lt;code&gt;$GITHUB_ENV&lt;/code&gt;&lt;/strong&gt;), making it accessible to subsequent steps in the workflow as &lt;strong&gt;&lt;code&gt;env.RELEASE_VERSION&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Script Breakdown:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo "RELEASE_VERSION=$(gh release list --repo https://github.com/${{ github.repository }} --limit 3 | grep -o 'v.*' | sort -r | awk 'NR==1  {print $3}' | sed 's/^v//g; s/[^0-9\.]//g')" &amp;gt;&amp;gt; $GITHUB_ENV
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This one-liner script is performing the following tasks sequentially:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;List the last three releases of the repository.&lt;/li&gt;
&lt;li&gt;Search for version patterns and extract them.&lt;/li&gt;
&lt;li&gt;Sort the versions in reverse order to get the latest first.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;&lt;code&gt;awk&lt;/code&gt;&lt;/strong&gt; to print the third field (version number).&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;&lt;code&gt;sed&lt;/code&gt;&lt;/strong&gt; to format the version number by removing the 'v' and keeping only the numbers and dots.&lt;/li&gt;
&lt;li&gt;Set the formatted version number as &lt;strong&gt;&lt;code&gt;RELEASE_VERSION&lt;/code&gt;&lt;/strong&gt; in the environment variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;2. Patch version Step&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The “Patch version” step is responsible for updating the version number in &lt;strong&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/strong&gt; and pushing the changes to a new release branch. Here is the detailed explanation:&lt;/p&gt;

&lt;h3&gt;
  
  
  Logic:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Git configuration is set up with the GitHub actor’s name and a generic email.&lt;/li&gt;
&lt;li&gt;A new remote named &lt;strong&gt;&lt;code&gt;publisher&lt;/code&gt;&lt;/strong&gt; is added for pushing changes to the repository. The URL for the remote includes authentication information.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;&lt;code&gt;yarn config set version-git-tag&lt;/code&gt;&lt;/strong&gt; command is used to prevent Yarn from creating a git tag for the new version.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;yarn version --new-version&lt;/code&gt;&lt;/strong&gt; is used to update the version in &lt;strong&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/strong&gt; to the &lt;strong&gt;&lt;code&gt;RELEASE_VERSION&lt;/code&gt;&lt;/strong&gt; fetched earlier.&lt;/li&gt;
&lt;li&gt;These changes (the updated version in &lt;strong&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/strong&gt;) are committed with a commit message indicating the updated version number.&lt;/li&gt;
&lt;li&gt;The changes are then pushed to a new branch in the format &lt;strong&gt;&lt;code&gt;release/v${RELEASE_VERSION}&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Script Breakdown:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.name ${GITHUB_ACTOR}
git config --global user.email "github-actions@github.com"
git remote add publisher "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"

echo "Release version: ${{env.RELEASE_VERSION}}"

yarn config set version-git-tag false
yarn version --new-version ${{env.RELEASE_VERSION}}

git commit package.json -m "Updated package.json version to version released ${{env.RELEASE_VERSION}}"
git push publisher HEAD:release/v${{env.RELEASE_VERSION}}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This script:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configures git with a user name and email.&lt;/li&gt;
&lt;li&gt;Adds a new remote for pushing, with the URL containing the GitHub token for authentication.&lt;/li&gt;
&lt;li&gt;Prevents Yarn from creating a git tag for the version.&lt;/li&gt;
&lt;li&gt;Updates the &lt;strong&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/strong&gt; version to the &lt;strong&gt;&lt;code&gt;RELEASE_VERSION&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Commits the updated &lt;strong&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/strong&gt; file.&lt;/li&gt;
&lt;li&gt;Pushes the commit to a new release branch named &lt;strong&gt;&lt;code&gt;release/v${RELEASE_VERSION}&lt;/code&gt;&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Both "Set env" and "Patch version" steps are crucial for ensuring the project version is consistently and accurately managed in the release process. The “Set env” step fetches and sets the latest release version, while the “Patch version” step uses this version to update &lt;strong&gt;&lt;code&gt;package.json&lt;/code&gt;&lt;/strong&gt; and push the changes to a dedicated release branch.&lt;/p&gt;




&lt;h3&gt;
  
  
  GitHub repository configuration
&lt;/h3&gt;

&lt;p&gt;🔐 &lt;strong&gt;Empower Your Repository:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Embark on a quest to the heart of your GitHub repository. Within the sanctum of settings, bestow upon your workflows the permission to read and write. Arm them well for the automated adventures that lie ahead. 🛡️&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05zcpcxmmn9d828c3a34.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F05zcpcxmmn9d828c3a34.png" alt="Image description" width="696" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🤝 Create &lt;strong&gt;a New PR:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With your repository empowered, manifest a new Pull Request (PR). This can be a mere scroll of introduction, inscribing a few words in your README. It's but a step to awaken the magic within the GitHub actions. 📜&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0mp4jadhn7az8assgip.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0mp4jadhn7az8assgip.png" alt="Image description" width="694" height="481"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🏷️ &lt;strong&gt;Label the Milestones:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the bustling bazaar of your PR screen, forge the labels to mark the milestones of your package's journey. These tokens shall command the tides of versioning, guiding your package's growth and evolution. 🌊&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp0xm7ub19xaqugg0yk1v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp0xm7ub19xaqugg0yk1v.png" alt="Image description" width="461" height="184"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🚶‍♂️&lt;strong&gt;Proceed With No Version?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fear not the path unknown. Venture forth without a version label and behold as the default pact of a patch release unfolds, shepherding your package with gentle embrace. 🌌&lt;/p&gt;

&lt;p&gt;⚔️&lt;strong&gt;Merge and Unleash the Magic:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Merge your PR! Feel the surge of magic as the first workflow springs to life, etching the annals of its quest within the GitHub realms. ✨&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fds1osqiat6c5cyk5ntld.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fds1osqiat6c5cyk5ntld.png" alt="Image description" width="698" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhypf194vbn20ddq9lzz1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhypf194vbn20ddq9lzz1.png" alt="Image description" width="702" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🗺️ &lt;strong&gt;Discover Your Draft Release:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Embark upon the trails of your repository and venture into the “Release”. Lo! A draft release, freshly crafted, awaits your gaze. 📜&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjh8u6b9ue2r5ddmfwn9n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjh8u6b9ue2r5ddmfwn9n.png" alt="Image description" width="241" height="103"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F26q7bmo5djzt04nyfq0z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F26q7bmo5djzt04nyfq0z.png" alt="Image description" width="703" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;strong&gt;Bestow Your Words:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Adorn your draft release with tales and descriptions of your package's voyage. Unveil it to the world, unchecking the &lt;code&gt;pre-release&lt;/code&gt; charm, and let it sail the cosmic rivers as a published release. 🌟&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkao0ol4euowzfzjolgbz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkao0ol4euowzfzjolgbz.png" alt="Image description" width="699" height="629"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📜 &lt;strong&gt;The publish.yaml:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;With the release set forth into the world, the &lt;code&gt;publish.yaml&lt;/code&gt; pipeline awakens from its slumber, ready to unfurl its magic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx7cjtcaub7ndf4l5h8w0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx7cjtcaub7ndf4l5h8w0.png" alt="Image description" width="732" height="112"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🎉&lt;strong&gt;Celebration in Packages:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Upon the completion of this sacred rite, your package is born anew in the hallowed halls of GitHub Packages, eager to embark on countless adventures in the realms of code and computation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnledv6bsyiip9xrz95qe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnledv6bsyiip9xrz95qe.png" alt="Image description" width="295" height="100"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🧙‍♂️ &lt;strong&gt;Beholding Your Creation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the Packages sanctum of your GitHub repository, gaze upon your package, resplendent and ready to weave its magic in the world of code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6zgdccm9y5bo2knpjxop.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6zgdccm9y5bo2knpjxop.png" alt="Image description" width="697" height="522"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🗝️ &lt;strong&gt;The Key to Installation:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Heed these words, O noble coder! The &lt;code&gt;GITHUB_ACCESS_TOKEN&lt;/code&gt; is the key to installing your package. Guard it well, in local realms and the ethereal expanse of GitHub Actions in other repositories.&lt;/p&gt;

&lt;p&gt;In another repository, yearning for the magic of your package? Bestow upon it your personal access token as an environment elixir, named &lt;strong&gt;&lt;code&gt;$GITHUB_ACCESS_TOKEN&lt;/code&gt;&lt;/strong&gt;. Whisper these ancient words before the installation rite:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo //npm.pkg.github.com/:_authToken=$GITHUB_ACCESS_TOKEN &amp;gt;&amp;gt; ~/.npmrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In conclusion, I extend my heartfelt gratitude for accompanying me on this enlightening journey through the world of GitHub, workflows, and packages. Your time and engagement throughout this expedition is deeply valued.&lt;/p&gt;

&lt;p&gt;While embarking on the path to demystify the technical intricacies, I endeavoured to infuse an element of light-hearted humor and creativity in the narration. My sincerest hope is that this endeavour has not only been a source of valuable insight but also a fountain of joy and amusement.&lt;/p&gt;

&lt;p&gt;For a more tangible exploration, you are cordially invited to peruse the repository that bears the code of this endeavour. Embark on this link to navigate to the &lt;strong&gt;&lt;a href="https://github.com/vitoraguila/github-package-example" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;May your own journey in the vast universe of code be filled with exploration, learning, and countless successes. Your quest continues, noble reader, and the world of code and innovation eagerly awaits your contributions.&lt;/p&gt;

&lt;p&gt;With warm regards and a sprinkle of coding magic!&lt;/p&gt;

&lt;p&gt;Follow me on &lt;a href="https://github.com/vitoraguila" rel="noopener noreferrer"&gt;Github&lt;/a&gt;&lt;br&gt;
Follow me on &lt;a href="https://www.linkedin.com/in/vitoraguila/" rel="noopener noreferrer"&gt;Linkedin&lt;/a&gt;&lt;/p&gt;

</description>
      <category>npm</category>
      <category>githubactions</category>
      <category>typescript</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
