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

WIP #10

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft

WIP #10

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 6 additions & 29 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ on:
types: [created]

jobs:
build-test-publish:
test:
name: Build, test and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.CI_GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.ref }}

- uses: actions/setup-node@v2
with:
Expand All @@ -25,37 +26,13 @@ jobs:
registry-url: "https://registry.npmjs.org"
scope: "@keep-network"

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Build
run: yarn build

- name: Test
run: yarn test

- name: Setup git credentials
if: github.event_name != 'pull_request'
run: |
git config user.name Heimdall
git config user.name @thesis-heimdall
git config user.email thesis-heimdall@users.noreply.github.com

# On main merge or manual workflow dispatch publish a pre-release package.
# Automatically bump version based on the current version stored in package.json.
- name: Publish pre-release package
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
run: yarn publish --non-interactive --prerelease --preid pre --message "Pre-release v%s [skip ci]" --tag "pre"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# On release creation publish a release package with the same version as
# the one stored in package.json.
- name: Publish release package
if: github.event_name == 'release'
run: yarn publish --non-interactive --message "Release v%s [skip ci]" --tag "latest"
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
echo "TEST" >> test.txt
git add test.txt
git commit -m "TEST [skip ci]"

- name: Push git commit
if: github.event_name != 'pull_request'
run: git push
20 changes: 20 additions & 0 deletions test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST
TEST