Skip to content

Commit

Permalink
chore(version): update logic on naming (#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
stavares843 authored Nov 9, 2024
1 parent 730164d commit 99de501
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
16 changes: 10 additions & 6 deletions .github/workflows/zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,26 @@ jobs:
- name: Run build script
run: npm run build

# Step 5: Create a single ZIP file in target/release and rename it with the version
# Step 5: Set version based on the tag
- name: Set version
id: set_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

# Step 6: Create a single ZIP file in target/release and rename it with the version
- name: Zip the build with version
run: |
VERSION=${GITHUB_REF#refs/tags/} # Extract version from tag name
mkdir -p target/release
zip -r target/release/Uplink_${VERSION}.zip ./build # Name the ZIP file with version
# Step 6: Upload the ZIP file as an artifact
# Step 7: Upload the ZIP file as an artifact
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build-zip
path: target/release/Uplink_${GITHUB_REF#refs/tags/}.zip
path: target/release/Uplink_${VERSION}.zip

# Step 7: Copy file to release
# Step 8: Copy file to release
- name: Copy file to release
uses: softprops/action-gh-release@v2
with:
files: target/release/Uplink_${GITHUB_REF#refs/tags/}.zip
files: target/release/Uplink_${VERSION}.zip
3 changes: 3 additions & 0 deletions updateVersion.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import fs from 'fs'
import path from 'path'

// Retrieve the directory name from the current file path
const __dirname = path.dirname(new URL(import.meta.url).pathname)

const VERSION = process.env.RELEASE_VERSION

if (!VERSION) {
Expand Down

0 comments on commit 99de501

Please sign in to comment.