Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI/CD #2

Open
psimk opened this issue Feb 18, 2021 · 4 comments
Open

CI/CD #2

psimk opened this issue Feb 18, 2021 · 4 comments
Labels
enhancement New feature or request internal Improving the internal codebase and its usage

Comments

@psimk
Copy link

psimk commented Feb 18, 2021

The process of publishing a pota package is fully manual now:

  1. make changes and commit them
  2. do npm version <newversion>
  3. do npm publish
  4. commit the new version with a message signifying the new version

Ideally, we would replace the last 3 steps with of a github action, that could be manually triggered for any of our packages. Later on, we can add onto the actions and have them test the code as well (e.g. #55)

@psimk psimk changed the title ### CI/CD CI/CD Feb 18, 2021
@psimk psimk added the enhancement New feature or request label Feb 22, 2021
@crevulus
Copy link

Can you lay out exactly what steps we need here? I have a couple of scripts we should be able to adapt.

@psimk psimk added the internal Improving the internal codebase and its usage label Apr 26, 2022
@psimk
Copy link
Author

psimk commented Apr 26, 2022

@crevulus
I updated the description, hope the task is a bit clearer now 😄

@MickJasker
Copy link

You can use the release functionality to make this easier:

name: Release

on:
  release:
    types:
      - published

jobs:
  release:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
        with:
          ref: ${{ github.event.release.target_commitish }}

      - name: Use Node.js 16
        uses: actions/setup-node@v1
        with:
          node-version: 16
          always-auth: true
          registry-url: 'https://registry.npmjs.org'

      - name: Install dependencies
        run: yarn install

      - name: Upgrade version
        run: |
          git config user.name github-actions
          git config user.email github-actions@github.com
          npm version --no-git-tag-version ${{ github.event.release.tag_name }}
          git add .
          git commit -m "Release version ${{ github.event.release.tag_name }}"
          git push
      - name: Publish to NPM
        run: yarn publish --non-interactive
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

The downside is that you need to disable branch protections to make the commit on the main branch

@psimk
Copy link
Author

psimk commented Apr 26, 2022

I guess we could indeed just fully automate publishing from the get go, but then we would have to figure out how to create releases (#56) first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internal Improving the internal codebase and its usage
Projects
None yet
Development

No branches or pull requests

3 participants