Skip to content

Commit

Permalink
CHORE Add release upload step to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachel Roppolo authored and Rachel Roppolo committed Oct 23, 2021
1 parent 7818f4f commit 37158cb
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/create-new-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v1
- run: npm config set "@fortawesome:registry" https://npm.fontawesome.com/ &&
npm config set "//npm.fontawesome.com/:_authToken" $FONTAWESOME_NPM_AUTH_TOKEN
- run: yarn install

- name: Create release branch
run: git checkout -b release/${{ github.event.inputs.version }}
Expand Down Expand Up @@ -44,6 +48,9 @@ jobs:
- name: Merge release branch to main
run: git merge --no-ff release/${{ github.event.inputs.version }}

- name: Push main branch
run: git push origin main

- name: Create tag
run: git tag -a ${{ github.event.inputs.version }} -m v${{ github.event.inputs.version }}

Expand All @@ -53,28 +60,39 @@ jobs:
- name: Merge release branch to develop
run: git merge --no-ff release/${{ github.event.inputs.version }}

- name: Push develop branch
run: git push origin develop

- name: Delete release branch
run: git branch -d release/${{ github.event.inputs.version }}

# Build assets
- run: yarn build
- run: npm pack
- name: Extract Package Version
id: extract_version
uses: Saionaro/extract-package-version@v1.1.1

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
release_name: Release v${{ github.event.inputs.version }}
tag_name: v${{ steps.extract_version.outputs.version }}
release_name: Release v${{ steps.extract_version.outputs.version }}
body_path:
draft: false
prerelease: false

# Upload assets to the release
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./user-interviews-ui-design-system-${{ github.event.inputs.version }}.tgz
asset_name: user-interviews-ui-design-system-${{ github.event.inputs.version }}.tgz
asset_path: ./user-interviews-ui-design-system-${{ steps.extract_version.outputs.version }}.tgz
asset_name: user-interviews-ui-design-system-${{ steps.extract_version.outputs.version }}.tgz
asset_content_type: application/tar+gzip

0 comments on commit 37158cb

Please sign in to comment.