Skip to content

Commit

Permalink
Fix: dry run in gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
ur-fault committed Jun 2, 2024
1 parent da97d99 commit 98aa251
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ jobs:
run: |
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
echo "DRY_RUN=${{ github.event.inputs.dry-run }}" >> $GITHUB_ENV
echo "DO_SMT=${{ github.event.inputs.dry-run != 'yes' }}" >> $GITHUB_ENV
echo "VERSION: ${{ github.event.inputs.version }}"
echo "DRY_RUN: ${{ github.event.inputs.dry-run }}"
- uses: actions/checkout@v4

Expand All @@ -60,13 +58,13 @@ jobs:
fi
- name: Create GitHub release
if: ${{ env.DO_SMT }}
if: env.DRY_RUN != 'yes'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create $VERSION --draft --verify-tag --title $VERSION
outputs:
version: ${{ env.VERSION }}
do_smt: ${{ env.DO_SMT }}
dry_run: ${{ env.DRY_RUN }}

build-release:
name: build-release
Expand Down Expand Up @@ -207,7 +205,7 @@ jobs:
cp "$BIN" "$NEW_BIN"
- name: Upload release archive
if: ${{ fromJSON(needs.create-release.outputs.do_smt) == true }}
if: ${{ needs.create-release.outputs.dry_run != 'yes' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
Expand Down Expand Up @@ -276,7 +274,7 @@ jobs:
mv $DEB_DIR/$DEB_BUILD_NAME $DEB_NAME
- name: Upload release archive
if: ${{ fromJSON(needs.create-release.outputs.do_smt) == true }}
if: ${{ needs.create-release.outputs.dry_run != 'yes' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
Expand Down Expand Up @@ -305,17 +303,18 @@ jobs:
- run: sudo apt update && sudo apt install libasound2-dev

- name: publish cmaze
if: ${{ fromJSON(needs.create-release.outputs.do_smt) == true }}
if: ${{ needs.create-release.outputs.dry_run != 'yes' }}
uses: katyo/publish-crates@v2
with:
path: ./cmaze
registry-token: ${{ secrets.CRATES_IO }}
ignore-unpublished-changes: true

- name: publish tmaze
if: ${{ fromJSON(needs.create-release.outputs.do_smt) == true }}
if: ${{ needs.create-release.outputs.dry_run != 'yes' }}
uses: katyo/publish-crates@v2
with:
path: ./tmaze
registry-token: ${{ secrets.CRATES_IO }}
ignore-unpublished-changes: true

0 comments on commit 98aa251

Please sign in to comment.