Skip to content

Commit

Permalink
chore: Corrección de errores y mejoras en el lanzamiento
Browse files Browse the repository at this point in the history
  • Loading branch information
BarraR3port committed Jun 11, 2024
1 parent e30dcba commit c8c32fc
Show file tree
Hide file tree
Showing 6 changed files with 13,228 additions and 12,824 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
});
release = data;
}
console.log(`Release ID: ${release.id}`);
return { release_id: release.id };
build-tauri:
Expand Down Expand Up @@ -122,6 +123,7 @@ jobs:
run: |
assets=($(find ./src-tauri/target/release/bundle -type f))
for asset in "${assets[@]}"; do
echo "Uploading $asset"
gh release upload ${{ needs.create-or-find-release.outputs.release_id }} "$asset" --clobber
done
env:
Expand Down
74 changes: 74 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: "release"
on:
workflow_dispatch:
push:
tags:
- "*"
branches:
- "*"
paths:
- "**"
pull_request:
types: [opened, synchronize, reopened]

jobs:
create-or-find-release:
if: github.event_name == 'workflow_dispatch' || github.actor == 'semantic-release-bot'
permissions:
contents: write
runs-on: ubuntu-20.04
outputs:
release_id: ${{ steps.set-release-id.outputs.release_id }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"

- name: Get version
run: echo "PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV

- name: Find or create release
id: set-release-id
uses: actions/github-script@v6
with:
script: |
const version = `v${process.env.PACKAGE_VERSION}`;
const { data: releases } = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
});
let release = releases.find(r => r.tag_name === version);
if (!release) {
const { data } = await github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: version,
name: version,
body: '*This release was generated automatically using GitHub Actions.*',
draft: true,
prerelease: false
});
release = data;
}
console.log(`Release ID: ${release.id}`);
return { release_id: release.id };
build-tauri:
needs: create-or-find-release
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [windows-latest, macos-latest, ubuntu-latest]

runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Print Release Id
run: echo ${{ needs.create-or-find-release.outputs.release_id }}
Loading

0 comments on commit c8c32fc

Please sign in to comment.