Skip to content

Commit 6e68f2b

Browse files
test 7
1 parent b570d22 commit 6e68f2b

File tree

3 files changed

+8
-107
lines changed

3 files changed

+8
-107
lines changed

.github/workflows/createRelease.yaml

Lines changed: 7 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -62,117 +62,18 @@ jobs:
6262
with:
6363
node-version-file: .nvmrc
6464

65-
- run: echo upload url in another job
66-
- run: echo "${{ needs.create-release.outputs.upload_url }}"
65+
- name: Package artifact
66+
run: npm run package
6767

68-
- run: echo "some text" > my-artifact.txt
68+
- name: Compress artifact
69+
run: zip -r my-artifact.zip dist/*
6970

7071
- name: Upload Release Asset
7172
uses: actions/upload-release-asset@v1
7273
env:
7374
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7475
with:
7576
upload_url: ${{ needs.create-release.outputs.upload_url }}
76-
asset_path: ./my-artifact.txt
77-
asset_name: my-artifact-${{ needs.create-release.outputs.version }}.txt
78-
asset_content_type: text/plain
79-
# asset_path: ./my-artifact.zip
80-
# asset_name: my-artifact.zip
81-
# asset_content_type: application/zip
82-
83-
# deploy:
84-
# name: Deploy
85-
# strategy:
86-
# fail-fast: false
87-
# matrix:
88-
# os: [windows-latest]
89-
# runs-on: ${{ matrix.os }}
90-
# steps:
91-
# - uses: actions/checkout@v4
92-
# - uses: actions/setup-node@v4
93-
# with:
94-
# node-version-file: .nvmrc
95-
# - run: npm --color install
96-
# - run: npm --color run compile
97-
# - run: xvfb-run -a npm --color run test:ci
98-
# if: runner.os == 'Linux'
99-
# - run: npm --color run test:ci
100-
# if: runner.os != 'Linux'
101-
# name: Create Release with Platform-Specific Assets
102-
103-
# on:
104-
# push:
105-
# branches:
106-
# - main
107-
108-
# permissions:
109-
# contents: write # Grants write permissions for creating tags and releases
110-
111-
# jobs:
112-
# build-and-release:
113-
# runs-on: ubuntu-latest
114-
115-
# strategy:
116-
# matrix:
117-
# platform: [linux, macos, windows]
118-
# name: Build on ${{ matrix.platform }}
119-
120-
# steps:
121-
# # Step 1: Checkout repository
122-
# - name: Checkout repository
123-
# uses: actions/checkout@v3
124-
125-
# # Step 2: Set up Node.js
126-
# - name: Set up Node.js
127-
# uses: actions/setup-node@v3
128-
# with:
129-
# node-version: '16'
130-
131-
# # Step 3: Read version from package.json (only runs once across the matrix)
132-
# - name: Read version from package.json
133-
# id: get_version
134-
# if: ${{ matrix.platform == 'linux' }} # Runs only once on Linux
135-
# run: |
136-
# VERSION=$(node -p "require('./package.json').version")
137-
# echo "version=$VERSION" >> $GITHUB_ENV
138-
139-
# # Step 4: Build the assets for each platform
140-
# - name: Build assets
141-
# run: |
142-
# echo "Building for ${{ matrix.platform }}"
143-
# mkdir -p dist
144-
# echo "Sample artifact for ${{ matrix.platform }}" > dist/${{ matrix.platform }}-artifact.txt
145-
# env:
146-
# VERSION: ${{ env.version }}
147-
148-
# # Step 5: Upload release assets for each platform
149-
# - name: Configure Git
150-
# run: |
151-
# git config user.name "github-actions[bot]"
152-
# git config user.email "github-actions[bot]@users.noreply.github.com"
153-
154-
# - name: Create GitHub release (only first platform creates it)
155-
# if: ${{ matrix.platform == 'linux' }}
156-
# uses: actions/create-release@v1
157-
# id: create_release
158-
# with:
159-
# tag_name: "v${{ env.version }}"
160-
# release_name: "Release v${{ env.version }}"
161-
# body: "This release includes platform-specific assets."
162-
# draft: false
163-
# prerelease: false
164-
# env:
165-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
166-
167-
# - name: Upload release asset for ${{ matrix.platform }}
168-
# uses: actions/upload-release-asset@v1
169-
# with:
170-
# upload_url: ${{ steps.create_release.outputs.upload_url || 'https://api.github.com/repos/${{ github.repository }}/releases/latest/assets' }}
171-
# asset_path: dist/${{ matrix.platform }}-artifact.txt
172-
# asset_name: ${{ matrix.platform }}-artifact.txt
173-
# asset_content_type: text/plain
174-
# env:
175-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176-
177-
# 'https://api.github.com/repos/${{ github.repository }}/releases/latest/assets'
178-
# https://api.github.com/repos/AndreasArvidsson/clippy//releases/latest/assets
77+
asset_path: ./my-artifact.zip
78+
asset_name: my-artifact.zip
79+
asset_content_type: application/zip

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"build": "npm run compile && npm run prepareAssets",
1414
"compile": "tsc -p .",
1515
"prepareAssets": "tsx prepareAssets.ts",
16-
"package": "npm run build && tsx packager.ts",
16+
"package": "npm run build && tsx package.ts",
1717
"test": "eslint src && prettier --check .",
1818
"fix": "prettier --write ."
1919
},
File renamed without changes.

0 commit comments

Comments
 (0)