From d63fafdc3834ceb69c137d1c9c5e07b92a03ea0d Mon Sep 17 00:00:00 2001 From: Patrick Mowrer Date: Wed, 17 Jan 2024 08:09:41 -0500 Subject: [PATCH] ci: Migrate from Travis CI to GitHub Actions Co-Authored-By: Felix Mann Closes #140 --- .github/workflows/release-preview.yml | 15 +++++++++++++++ .github/workflows/release.yml | 19 +++++++++++++++++++ .github/workflows/tests.yml | 13 +++++++++++++ .travis.yml | 11 ----------- 4 files changed, 47 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/release-preview.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/release-preview.yml b/.github/workflows/release-preview.yml new file mode 100644 index 0000000..10e4d6e --- /dev/null +++ b/.github/workflows/release-preview.yml @@ -0,0 +1,15 @@ +name: Release preview +on: [pull_request] +jobs: + release-preview: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + # semantic-release dry-run workaround https://github.com/semantic-release/semantic-release/issues/1890#issuecomment-974512960 + - run: git checkout -b ${{ github.head_ref }} + - run: unset GITHUB_ACTIONS && npx semantic-release-github-pr --debug \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..281a2ee --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,19 @@ +name: Release + +on: + push: + branches: + - master + +jobs: + release: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + - run: npx semantic-release --debug diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..aef6c1e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,13 @@ +name: Tests +on: [pull_request] +jobs: + run-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 20 + - name: Git credentials need to be set when testing git utils + run: git config --global user.email user@test.com && git config --global user.name "Test user" + - run: yarn && yarn test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5beea19..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -node_js: - - 10 -notifications: - email: false -before_install: - - curl -o- -L https://yarnpkg.com/install.sh | bash - - export PATH="$HOME/.yarn/bin:$PATH" -after_success: - - "[[ $TRAVIS_PULL_REQUEST != 'false' ]] && npx semantic-release-github-pr --debug" - - npx semantic-release --debug \ No newline at end of file