Open psimk opened 3 years ago
Can you lay out exactly what steps we need here? I have a couple of scripts we should be able to adapt.
@crevulus I updated the description, hope the task is a bit clearer now :smile:
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
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 (https://github.com/mediamonks/pota/issues/56) first.
The process of publishing a pota package is fully manual now:
npm version <newversion>
npm publish
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. https://github.com/mediamonks/pota/issues/55)