{"id":26646838,"url":"https://github.com/uBrunoow/github-actions-for-npm-registery","last_synced_at":"2025-03-24T23:40:02.784Z","repository":{"id":227917500,"uuid":"772717905","full_name":"uBrunoow/github-actions-for-npm-registery","owner":"uBrunoow","description":"This is a repo that teachs how you can create your own npm package and publish in the npm for other users use your package, this is very util and an example that i have is that i use in work a \"boilerplate\" using npm to keep a pattern of folders and archives in the new proejct this being for web or for mobile","archived":false,"fork":false,"pushed_at":"2024-03-17T12:39:29.000Z","size":26,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-22T14:04:04.609Z","etag":null,"topics":["github-actions","javascript","npm","npm-packages","work"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uBrunoow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-03-15T18:46:36.000Z","updated_at":"2025-03-20T23:39:59.000Z","dependencies_parsed_at":"2024-03-17T13:40:05.375Z","dependency_job_id":null,"html_url":"https://github.com/uBrunoow/github-actions-for-npm-registery","commit_stats":null,"previous_names":["ubrunoow/teste","ubrunoow/github-actions-for-npm-registery"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uBrunoow%2Fgithub-actions-for-npm-registery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uBrunoow%2Fgithub-actions-for-npm-registery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uBrunoow%2Fgithub-actions-for-npm-registery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uBrunoow%2Fgithub-actions-for-npm-registery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uBrunoow","download_url":"https://codeload.github.com/uBrunoow/github-actions-for-npm-registery/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244966501,"owners_count":20539795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","javascript","npm","npm-packages","work"],"created_at":"2025-03-24T23:40:01.803Z","updated_at":"2025-03-24T23:40:02.776Z","avatar_url":"https://github.com/uBrunoow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Publish de um pacote npm usando github actions\n\nPara realizar isso foi demanda de muito tempo então vai valer a pena criar esse README.md kkkkk\n\n1. Criar a pasta .github/workflows\n2. Criar um arquivo chamado npm-publish.yml\n3. Colar esse código\n\n```bash \nname: Release package\non:\n  workflow_dispatch:\n    inputs:\n      release-type:\n        description: 'Release type (one of): patch, minor, major, prepatch, preminor, premajor, prerelease'\n        required: true\njobs:\n  release:\n    runs-on: ubuntu-latest\n    steps:\n      # Checkout project repository\n      - name: Checkout\n        uses: actions/checkout@v3\n\n      # Setup Node.js environment\n      - name: Setup Node.js\n        uses: actions/setup-node@v3\n        with:\n          registry-url: https://registry.npmjs.org/\n          node-version: '14'\n\n      # Install dependencies (required by Run tests step)\n      #- name: Install dependencies\n      #  run: yarn install\n\n      # Tests\n      #- name: Run tests\n      #  run: yarn test\n\n      # Configure Git\n      - name: Git configuration\n        run: |\n          git config --global user.email \"41898282+github-actions[bot]@users.noreply.github.com\"\n          git config --global user.name \"GitHub Actions\"\n\n      # Bump package version\n      # Use tag latest\n      - name: Bump release version\n        if: startsWith(github.event.inputs.release-type, 'pre') != true\n        run: |\n          echo \"NEW_VERSION=$(npm --no-git-tag-version version $RELEASE_TYPE)\" \u003e\u003e $GITHUB_ENV\n          echo \"RELEASE_TAG=latest\" \u003e\u003e $GITHUB_ENV\n        env:\n          RELEASE_TYPE: ${{ github.event.inputs.release-type }}\n\n      # Bump package pre-release version\n      # Use tag beta for pre-release versions\n      - name: Bump pre-release version\n        if: startsWith(github.event.inputs.release-type, 'pre')\n        run: |\n          echo \"NEW_VERSION=$(npm --no-git-tag-version --preid=beta version $RELEASE_TYPE\n          echo \"RELEASE_TAG=beta\" \u003e\u003e $GITHUB_ENV\n        env:\n          RELEASE_TYPE: ${{ github.event.inputs.release-type }}\n\n      # Update changelog unreleased section with new version\n      - name: Update changelog\n        uses: superfaceai/release-changelog-action@v1\n        with:\n          path-to-changelog: CHANGELOG.md\n          version: ${{ env.NEW_VERSION }}\n          operation: release\n\n      # Commit changes\n      - name: Commit CHANGELOG.md and package.json changes and create tag\n        run: |\n          git add \"package.json\"\n          git add \"CHANGELOG.md\"\n          git commit -m \"chore: release ${{ env.NEW_VERSION }}\"\n          git tag ${{ env.NEW_VERSION }}\n\n      # Publish version to public repository\n      - name: Publish\n        run: yarn publish --verbose --access public --tag ${{ env.RELEASE_TAG }}\n        env:\n          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}\n\n      # Push repository changes\n      - name: Push changes to repository\n        env:\n          GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}\n        run: |\n          git push origin \u0026\u0026 git push --tags\n\n      # Read version changelog\n      - id: get-changelog\n        name: Get version changelog\n        uses: superfaceai/release-changelog-action@v1\n        with:\n          path-to-changelog: CHANGELOG.md\n          version: ${{ env.NEW_VERSION }}\n          operation: read\n\n      # Update GitHub release with changelog\n      - name: Update GitHub release documentation\n        uses: softprops/action-gh-release@v1\n        with:\n          tag_name: ${{ env.NEW_VERSION }}\n          body: ${{ steps.get-changelog.outputs.changelog }}\n          prerelease: ${{ startsWith(github.event.inputs.release-type, 'pre') }}\n        env:\n          GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}\n```\n4. Criar os secrets do github para permitir o publish e a troca de versão\n5. Criar o CHANGELOG.md\n6. Colocar isso aqui no changelog:\n\n```bash\n# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),\nand this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n\n## [Unreleased]\n\n### Added\n\n- Changelog\n```\nAgora toda vez que vocẽ fizer um commit para a main e quiser publicar o seu pacote npm, vocẽ irá em actions (github) e ir em Release package, selecionar run workflow e digitar patch, assim ele começará a rodar o workflow e publicará seu package no npm. Perfeito!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FuBrunoow%2Fgithub-actions-for-npm-registery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FuBrunoow%2Fgithub-actions-for-npm-registery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FuBrunoow%2Fgithub-actions-for-npm-registery/lists"}