Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Rogerson committed Sep 27, 2023
1 parent 2ca84dc commit 8fa321a
Showing 1 changed file with 89 additions and 49 deletions.
138 changes: 89 additions & 49 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,70 +11,110 @@ on:
types: [ published ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Print tooling versions
run: |
node --version
npm --version
docker --version
python --version
- name: Run npm ci
run: npm ci
- run: npm run build
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: build
path: ./dist

test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: build
path: ./dist
- run: npm install --no-save tap-xunit
- run: mkdir -p _out/unit _out/e2e
- run: npm test -- --timeout=1m
# build:
# runs-on: ubuntu-latest
# steps:
# - name: Check out repository
# uses: actions/checkout@v3
# with:
# fetch-depth: 0
# - name: Setup node
# uses: actions/setup-node@v3
# with:
# node-version: 16
# - name: Print tooling versions
# run: |
# node --version
# npm --version
# docker --version
# python --version
# - name: Run npm ci
# run: npm ci
# - run: npm run build
# - name: Upload build artifact
# uses: actions/upload-artifact@v3
# with:
# name: build
# path: ./dist

# test:
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Check out repository
# uses: actions/checkout@v3
# - name: Setup node
# uses: actions/setup-node@v3
# with:
# node-version: 16
# - name: Download build artifact
# uses: actions/download-artifact@v3
# with:
# name: build
# path: ./dist
# - run: npm install --no-save tap-xunit
# - run: mkdir -p _out/unit _out/e2e
# - run: npm test -- --timeout=1m

version-bump:
release-to-staging:
if: github.event_name == 'pull_request' && github.head_ref == 'master'
runs-on: ubuntu-latest

steps:
- name: Checkout Code
- name: Check out repository
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Extract PR title
id: extract_title
run: |
TITLE="${{ github.event.pull_request.title }}"
echo "::set-output name=pr_title::$TITLE"
- name: Determine Version Increment
id: version_increment
run: |
TITLE="${{ steps.extract_title.outputs.pr_title }}"
if [[ $TITLE == Patch* ]]; then
echo "::set-output name=increment::patch"
elif [[ $TITLE == Minor* ]]; then
echo "::set-output name=increment::minor"
elif [[ $TITLE == Major* ]]; then
echo "::set-output name=increment::major"
else
echo "Invalid PR title. Exiting."
exit 1
fi
- uses: rickstaa/action-get-semver@v1
id: get_semver
with:
bump_level: "minor"
bump_level: "${{ steps.version_increment.outputs.increment }}"

- name: Print current and next version
run: |
echo "Current version: ${{ steps.get_semver.outputs.current_version }}"
echo "Current version: ${{ steps.get_semver.outputs.current_version }}"
echo "Next version: ${{ steps.get_semver.outputs.next_version }}"
# - name: setup-docker
# uses: docker-practice/actions-setup-docker@master
# - name: Download build artifact
# uses: actions/download-artifact@v3
# with:
# name: build
# path: ./dist
# - name: Generate version
# run: ./create-version-file.sh
# - name: Login to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_HUB_STAGING_LOGIN }}
# password: ${{ secrets.DOCKER_HUB_STAGING_PASSWORD }}
# - name: Build and push image
# run: docker buildx build --platform linux/amd64,linux/arm64 -t orbsnetworkstaging/ethereum-writer:$(cat .version) --push .


# release-to-staging:
# if: github.event_name == 'pull_request' && github.head_ref == 'main'
# needs: build-and-test
Expand Down

0 comments on commit 8fa321a

Please sign in to comment.