Skip to content

Commit

Permalink
ci: deploy only on the main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
florianvazelle committed Oct 26, 2023
1 parent 131ecf6 commit 169258f
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@ jobs:
name: Create Release
steps:
- name: Check Tag
id: tag
run: |
if [[ ${{ env.BRANCH_NAME }} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "tag_name=${{ env.BRANCH_NAME }}" >> "$GITHUB_ENV"
echo "tag_name=${{ env.BRANCH_NAME }}" >> "$GITHUB_OUTPUT"
else
echo "tag_name=null" >> "$GITHUB_ENV"
echo "tag_name=null" >> "$GITHUB_OUTPUT"
fi
create_release:
needs: set_tag_name

if: ${{ env.tag_name != 'null' }}
if: ${{ needs.set_tag_name.outputs.tag != 'null' }}
runs-on: ubuntu-22.04

name: Create Release
steps:
- name: Create release
run: |
gh release create "${{ env.tag_name }}" \
gh release create "${{ env.BRANCH_NAME }}" \
--repo="${{ github.repository }}" \
--title="v${{ env.tag_name }}" \
--title="v${{ env.BRANCH_NAME }}" \
--generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -67,16 +67,16 @@ jobs:
uses: dawidd6/action-download-artifact@v2
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: Marble-${{ matrix.platform }}-v${{ env.tag_name }}
name: Marble-${{ matrix.platform }}-v${{ env.BRANCH_NAME }}
path: dist/${{ matrix.platform }}
skip_unpack: true

- name: Upload to release
run: |
gh release upload "${{ env.tag_name }}" \
gh release upload "${{ env.BRANCH_NAME }}" \
--repo="${{ github.repository }}" \
--clobber \
dist/${{ matrix.platform }}/Marble-${{ matrix.platform }}-v${{ env.tag_name }}.zip
dist/${{ matrix.platform }}/Marble-${{ matrix.platform }}-v${{ env.BRANCH_NAME }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -87,5 +87,5 @@ jobs:
CHANNEL: ${{ matrix.platform }}
ITCH_GAME: marble
ITCH_USER: mechanical-flower
PACKAGE: dist/${{ matrix.platform }}/Marble-${{ matrix.platform }}-v${{ env.tag_name }}.zip
VERSION: ${{ env.tag_name }}
PACKAGE: dist/${{ matrix.platform }}/Marble-${{ matrix.platform }}-v${{ env.BRANCH_NAME }}.zip
VERSION: ${{ env.BRANCH_NAME }}

0 comments on commit 169258f

Please sign in to comment.