fix: couple of code tunings to align alpha with main branch ( minus g… #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Stage | |
env: | |
# 🖊️ EDIT to change the image build settings. | |
IMAGE_NAME: exhort-javascript-api | |
IMAGE_REGISTRY: quay.io/ecosystem-appeng | |
IMAGE_REGISTRY_USER: ${{ secrets.IMAGE_REGISTRY_USER }} | |
IMAGE_REGISTRY_PASSWORD: ${{ secrets.IMAGE_REGISTRY_PASSWORD }} | |
DOCKERFILE_PATH: ./docker-image/Dockerfiles/Dockerfile.alpha | |
GITHUB_PACKAGE_REGISTRY_ACCESS_TOKEN: ${{ secrets.GITHUB_PACKAGE_REGISTRY_ACCESS_TOKEN }} | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- alpha | |
paths: | |
- "generated/**" | |
- "src/**" | |
- "package-lock.json" | |
- "package.json" | |
- "tsconfig.json" | |
- "config/config.properties" | |
jobs: | |
stage: | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'RHEcosystemAppEng' | |
environment: staging | |
name: Stage the project | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
ssh-key: ${{ secrets.DEPLOY_KEY }} | |
- name: Install node 18 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
cache: npm | |
registry-url: 'https://npm.pkg.github.com' | |
- name: Setup Java 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
cache: maven | |
- name: Install project modules | |
run: npm ci | |
- name: Lint source files | |
run: npm run lint | |
- name: Run unit tests | |
run: npm run test | |
- name: Configure git | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
- name: Update package with new version | |
id: bump | |
run: | | |
echo "version=$(npm version prerelease --no-git-tag-version --preid alpha)" >> "$GITHUB_OUTPUT" | |
# - name: Install project modules | |
# run: npm ci | |
- name: Compile project | |
run: npm run compile | |
- name: Run integration tests | |
working-directory: integration | |
run: EXHORT_ITS_USE_REAL_API=true bash ./run_its.sh | |
- name: Publish package | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npm publish | |
- name: Commit and push package modifications | |
run: | | |
git add package.json | |
git add package-lock.json | |
git commit -m "build: updated package with ${{ steps.bump.outputs.version }} [skip ci]" | |
git push | |
- name: Create and push new tag | |
run: | | |
git tag ${{ steps.bump.outputs.version }} -m "${{ steps.bump.outputs.version }}" | |
git push origin ${{ steps.bump.outputs.version }} | |
- name: Create a release | |
uses: actions/[email protected] | |
with: | |
github-token: ${{ secrets.STAGING_PAT }} | |
script: | | |
const repo_name = context.payload.repository.full_name | |
const response = await github.request('POST /repos/' + repo_name + '/releases', { | |
tag_name: '${{ steps.bump.outputs.version }}', | |
name: '${{ steps.bump.outputs.version }}', | |
prerelease: true, | |
generate_release_notes: true | |
}) |