Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBspheroid authored Oct 29, 2024
1 parent 7847cf1 commit 7c8d337
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions .github/workflows/main.yml
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

0 comments on commit 7c8d337

Please sign in to comment.