Disable debug api. #19
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: | |
workflow_dispatch: | |
push: | |
branches: 'master' | |
jobs: | |
env-setup: | |
runs-on: macos-latest | |
name: Wine Mac Apps Release | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.18.2' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: '8.9.2' | |
- name: Get package version | |
run: | | |
VERSION=$(jq -r .version < package.json) | |
echo $VERSION | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Check if tag exists | |
id: check_tag | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const tag = `v${{ env.VERSION }}` | |
const { data: tags } = await github.rest.git.listMatchingRefs({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
ref: `tags/${tag}`, | |
}); | |
if (tags.some(t => t.ref === `refs/tags/${tag}`)) { | |
console.log(`Tag ${tag} already exists. Skipping release.`); | |
return 'skip'; | |
} | |
console.log(`Tag ${tag} does not exist. Proceeding with release.`); | |
return 'proceed'; | |
result-encoding: string | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install dependencies and build | |
if: steps.check_tag.outputs.result == 'proceed' | |
run: pnpm install --no-frozen-lockfile && pnpm build | |
shell: bash | |
- name: Create Release | |
if: steps.check_tag.outputs.result == 'proceed' | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.VERSION }} | |
release_name: Release v${{ env.VERSION }} | |
body: 'Automatically generated release for version ${{ env.VERSION }}' | |
draft: false | |
prerelease: false | |
- name: Upload bundled files | |
if: steps.check_tag.outputs.result == 'proceed' | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: './apps/library-ui/dist/x64/Wine_Mac_Apps_x64.zip' | |
asset_name: Wine Mac Apps x64.zip | |
asset_content_type: application/zip |