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

Meta: move semantic-release from circle to actions #5514

Closed
1 of 3 tasks
rarkins opened this issue Feb 19, 2020 · 10 comments · Fixed by #5515
Closed
1 of 3 tasks

Meta: move semantic-release from circle to actions #5514

rarkins opened this issue Feb 19, 2020 · 10 comments · Fixed by #5515
Assignees

Comments

@rarkins
Copy link
Collaborator

rarkins commented Feb 19, 2020

Let's move releasing to Actions and then deprecate CircleCI use.

  • Define npm release token in Actions secrets (the embedded GitHub token in Actions should be enough for the GitHub part)
  • Add semantic releasing to Node 12 on Linux in Actions
  • Disable releasing on CircleCI

Note: I don't want to use any third party action for this, because of the risk of it stealing credentials.

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 19, 2020

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 19, 2020

NPM_TOKEN added to secrets

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 19, 2020

I'm trying to work out where this fits in to our actions currently:

We want it to only run once, e.g. on Node 12 on Linux only

We want it to run on master branch only (although semantic-release should be smart enough to skip if it's run on an alternative branch).

We want it to run only after build and test is completed.

@viceice
Copy link
Member

viceice commented Feb 19, 2020

then we need to add a new release job to test.yml which depends on test job.

we can add
if: github.ref == 'refs/heads/master' to the new job to only execute on master and save a worker

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 19, 2020

If it's a new job, does it execute within a new container and hence needs checkout + install + build first?

@viceice
Copy link
Member

viceice commented Feb 19, 2020

jepp

  release:
    name: release
    needs: test
    runs-on: ubuntu-latest
    if: github.ref == 'refs/heads/master'

    # tests shouldn't nee more than 10 min
    timeout-minutes: 15
  

    steps:
      - name: Set up Node.js
        uses: actions/setup-node@v1
        with:
          node-version: 12

      - name: Init platform
        id: init
        shell: bash
        run: |
          echo "::set-output name=yarn_cache::$(yarn cache dir)"
          git config --global core.autocrlf false
          git config --global core.symlinks true
          git config --global user.email 'bot@renovateapp.com'
          git config --global user.name  'Renovate Bot'
          node --version
          yarn --version

      - uses: actions/checkout@v2

      - name: Cache Yarn packages
        id: yarn_cache_packages
        uses: actions/cache@v1
        with:
          path: ${{ steps.init.outputs.yarn_cache }}
          key: v1-${{ runner.os }}-yarn_cache-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            v1-${{ runner.os }}-yarn_cache-

      - name: Cache node_modules
        uses: actions/cache@v1
        with:
          path: node_modules
          key: ${{ runner.os }}-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-${{ matrix.node-version }}-yarn-
            
      - run: yarn install --frozen-lockfile
      - run: yarn build
      - run: yarn semantic-release
      - run: curl -X POST -d '{}' $NETLIFY_DEPLOY_WEBHOOK

@viceice
Copy link
Member

viceice commented Feb 19, 2020

ok, env vars needs to be added from secrets

@viceice
Copy link
Member

viceice commented Feb 19, 2020

added condition to job above

@rarkins
Copy link
Collaborator Author

rarkins commented Feb 19, 2020

https://github.community/t5/GitHub-Actions/Is-there-a-way-to-depend-on-actions-from-another-file/td-p/35237

Wondering if we want to use GitHub's native "release" concept (which never seemed to get much use from anyone, but maybe actions will change that)

@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 19.140.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants