Skip to content

Commit

Permalink
Merge pull request #55 from shopware/ci/beta-release
Browse files Browse the repository at this point in the history
Add beta release for merge requests.
  • Loading branch information
ffrank913 authored Nov 29, 2024
2 parents 9163aad + f46e7b3 commit b66db39
Showing 1 changed file with 150 additions and 0 deletions.
150 changes: 150 additions & 0 deletions .github/workflows/publish-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Beta Release

on:
workflow_dispatch: # This allows manual triggering only from the Actions tab

jobs:
install:
runs-on: ubuntu-latest
steps:
- name: Checkout DIVE
uses: actions/checkout@main
- name: Setup Node.js
uses: actions/setup-node@main
- name: Search for cached dependencies
uses: actions/cache@main
id: yarn-cache
with:
path: node_modules
key:
node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install DIVE dependencies (if cache not found)
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
eslint:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout DIVE
uses: actions/checkout@main
- name: Search for cached dependencies
uses: actions/cache@main
id: yarn-cache
with:
path: node_modules
key:
node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install DIVE dependencies (if cache not found)
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- name: Lint DIVE
run: yarn lint
unit:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout DIVE
uses: actions/checkout@main
- name: Search for cached dependencies
uses: actions/cache@main
id: yarn-cache
with:
path: node_modules
key:
node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install DIVE dependencies (if cache not found)
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- name: Unit-Test DIVE (coverage)
run: yarn coverage
prettier-check:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout DIVE
uses: actions/checkout@main
- name: Search for cached dependencies
uses: actions/cache@main
id: yarn-cache
with:
path: node_modules
key:
node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install DIVE dependencies (if cache not found)
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- name: Prettier check DIVE
run: yarn prettier:check
build:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout
uses: actions/checkout@main
- name: Search for cached dependencies
uses: actions/cache@main
id: yarn-cache
with:
path: node_modules
key:
node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install dependencies (if cache not found)
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- name: Build DIVE
run: yarn build
lint-actions:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout
uses: actions/checkout@main
- name: Search for cached dependencies
uses: actions/cache@main
id: yarn-cache
with:
path: node_modules
key:
node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install dependencies (if cache not found)
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- name: Run lint-actions
run: bash ci/lint/lint-actions.sh
publish-beta:
needs: [unit, eslint, build, prettier-check, lint-actions]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }} # Use GitHub Token for authentication
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Search for cached dependencies
uses: actions/cache@v4
id: yarn-cache
with:
path: node_modules
key:
node-modules-${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- name: Install dependencies (if cache not found)
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn

- name: Authenticate with NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc

- name: Publish Beta Version
env:
PR_NUMBER: ${{ github.event.pull_request.number || 'workflow_dispatch' }}
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
yarn version --prerelease --preid beta
yarn publish --tag beta
git push origin --tags

0 comments on commit b66db39

Please sign in to comment.