Skip to content

Build and upload artifact #13

Build and upload artifact

Build and upload artifact #13

Workflow file for this run

name: Build and upload artifact
on:
push:
tags:
- v*
workflow_dispatch:
jobs:
build-package:
name: Build and export package
runs-on: ubuntu-latest
steps:
#Checkout
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
# Read package name and version from package.json
- name: Get package name and version
id: pkg
run: |
PKG_NAME=$(jq -r '.name' ./package.json)
PKG_VERSION=$(jq -r '.version' ./package.json)
PKG_FILENAME="$(basename $PKG_NAME)-$PKG_VERSION.tgz"
echo "pkg_name=$PKG_NAME" >> $GITHUB_OUTPUT
echo "pkg_version=$PKG_VERSION" >> $GITHUB_OUTPUT
echo "pkg_filename=$PKG_FILENAME" >> $GITHUB_OUTPUT
# Create .tgz tarball of the package folder
- name: Pack UPM package
run: |
tar -czf "${{ steps.pkg.outputs.pkg_filename }}" *
- name: Create local tag
run: git tag "v${{ steps.pkg.outputs.pkg_version }}"
- name: Push tag to GitHub
run: git push origin "v${{ steps.pkg.outputs.pkg_version }}"
- name: Create Draft Release
uses: softprops/action-gh-release@v2
with:
tag_name: "v${{ steps.pkg.outputs.pkg_version }}"
name: "Release v${{ steps.pkg.outputs.pkg_version }}"
body: |
🎉 New release of ${{ steps.pkg.outputs.pkg_name }}
Version: ${{ steps.pkg.outputs.pkg_version }}
## Changelog
- Feature A
- Fix B
files: ${{ steps.pkg.outputs.pkg_filename }},RELEASE_NOTES.md
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}