Skip to content

Commit

Permalink
Merge pull request #21 from CloudCannon/feat/release-file
Browse files Browse the repository at this point in the history
Upload dist files to the GH release
  • Loading branch information
rphillips-cc authored Nov 21, 2024
2 parents c43a302 + 77da834 commit 05e4eaa
Showing 1 changed file with 30 additions and 9 deletions.
39 changes: 30 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,32 @@ on:
- v*

jobs:
test:
test-and-build:
runs-on: ubuntu-24.04
steps:
- name: Clone
uses: actions/checkout@v3

- name: Install
- name: Install
run: npm ci

- name: Build
run: npm run build

- name: Unit Test
- name: Unit Test
run: npm run test

- name: Upload dist
uses: actions/upload-artifact@v4
with:
name: dist
path: |
dist/*
publish-github-release:
name: Publish to GitHub
runs-on: ubuntu-24.04
needs: test
needs: test-and-build
steps:
- name: Get Token
id: get_workflow_token
Expand All @@ -49,9 +56,21 @@ jobs:
NPM_TAG=$(node ./.backstage/get_npm_tag.cjs)
echo NPM_TAG="$NPM_TAG" >> $GITHUB_ENV
- name: Download dist
uses: actions/download-artifact@v4
with:
name: dist
path: dist

- name: List files
run: ls -R dist

- name: Stable Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') && env.NPM_TAG == 'latest'
with:
files: |
dist/*
env:
GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}

Expand All @@ -60,6 +79,8 @@ jobs:
if: startsWith(github.ref, 'refs/tags/') && env.NPM_TAG != 'latest'
with:
prerelease: true
files: |
dist/*
env:
GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}

Expand All @@ -83,19 +104,19 @@ jobs:
run: |
npm --no-git-tag-version version $GIT_VERSION
- name: Install
- name: Install
run: npm ci

- name: Build
- name: Build
run: npm run build

- name: Publish internal
uses: JS-DevTools/npm-publish@v3
with:
tag: ${{ env.NPM_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
registry: "https://npm.pkg.github.com"
registry: 'https://npm.pkg.github.com'

- name: Publish external
uses: JS-DevTools/npm-publish@v3
with:
Expand Down

0 comments on commit 05e4eaa

Please sign in to comment.