Skip to content

Commit

Permalink
conditional workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
proton committed Nov 27, 2023
1 parent ded980d commit e840d86
Showing 1 changed file with 32 additions and 29 deletions.
61 changes: 32 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,39 @@ jobs:
echo "version_exists=false" >> $GITHUB_OUTPUT
fi
- name: Tag and release
if: ${{ needs.check_tag.outputs.version_exists == 'false' }}
steps:
- name: Create tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.extract_version.outputs.version }}',
sha: context.sha
})
tag_and_release:
runs-on: ubuntu-latest
needs: check_tag
if: ${{ needs.check_tag.outputs.version_exists == 'false' }}

steps:
- name: Create tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.extract_version.outputs.version }}',
sha: context.sha
})
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: npm install
- name: Install dependencies
run: npm install

- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.extract_version.outputs.version }}
files: |
out/Kino.pub_${{ steps.extract_version.outputs.version }}.zip
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.extract_version.outputs.version }}
files: |
out/Kino.pub_${{ steps.extract_version.outputs.version }}.zip
- name: Publish Release URL
run: |
echo "Release URL: ${{ steps.create_release.outputs.upload_url }}"
- name: Publish Release URL
run: |
echo "Release URL: ${{ steps.create_release.outputs.upload_url }}"

0 comments on commit e840d86

Please sign in to comment.