-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7847cf1
commit 7c8d337
Showing
1 changed file
with
27 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,45 @@ | ||
# .github/workflows/release.yml | ||
name: Build and Release Package | ||
name: Build and Release | ||
|
||
|
||
jobs: | ||
build-and-release: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
- name: Set up Node.js environment | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: "16" # Specify your preferred Node.js version | ||
node-version: '16' # Specify your Node.js version | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build the package | ||
run: npm run build | ||
run: npm run build # Adjust this command to your build script | ||
|
||
- name: Create .tar.gz archive | ||
run: tar -czvf package.tar.gz ./build # Adjust the directory as needed | ||
|
||
- name: Prepare .tar file | ||
run: | | ||
mkdir release | ||
npm pack --pack-destination ./release | ||
cd release | ||
tar -cvf svelte-fontawesome.tar *.tgz | ||
- name: Create GitHub Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Provided by GitHub Actions | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload release asset | ||
- name: Upload Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
release_id: ${{ github.event.release.id }} | ||
asset_path: release/svelte-fontawesome.tar | ||
asset_name: svelte-fontawesome.tar | ||
asset_content_type: application/x-tar | ||
|
||
- name: Clean up | ||
run: rm -rf release | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./package.tar.gz | ||
asset_name: package.tar.gz | ||
asset_content_type: application/gzip |