fix ci? #31
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
name: Release | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build Windows | |
run: npm run package | |
- name: Zip Windows | |
run: | | |
cd out/fetchcat-win32-x64 | |
7z a -tzip ../../fetchcat-win32-x64.zip . | |
cd ../.. | |
- name: Build Linux | |
run: npm run make | |
- name: Get version | |
id: package | |
run: echo "::set-output name=version::$(node -p "require('./package.json').version")" | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ steps.package.outputs.version }}.${{ github.run_id }} | |
release_name: Release ${{ steps.package.outputs.version }}.${{ github.run_id }} | |
draft: false | |
prerelease: true | |
- name: List files | |
run: ls -la out | |
- name: Upload Windows | |
id: upload-release-asset-windows | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: out/fetchcat-win32-x64/fetchcat-win32-x64.zip | |
asset_name: fetchcat-win.zip | |
asset_content_type: application/octet-stream | |
- name: Upload Linux Debian | |
id: upload-release-asset-linux-debian | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: out/make/deb/x64/fetchcat_${{ steps.package.outputs.version }}_amd64.deb | |
asset_name: fetchcat-linux.deb | |
asset_content_type: application/octet-stream | |
- name: Upload Linux RPM | |
id: upload-release-asset-linux-rpm | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: out/make/rpm/x64/fetchcat-${{ steps.package.outputs.version }}-1.x86_64.rpm | |
asset_name: fetchcat-linux.rpm | |
asset_content_type: application/octet-stream |