Skip to content

Commit

Permalink
build: fix publish actions
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickDinh committed Mar 27, 2024
1 parent 972c195 commit cb6405a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
13 changes: 11 additions & 2 deletions .github/actions/create-release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,17 @@ inputs:
node-version:
description: 'The Node version'
required: true
default: 20
default: '20'
outputs:
release-published:
description: 'If the release was published'
value: ${{ steps.get-next-version.outputs.new-release-published }}
release-version:
description: 'The new release version'
value: ${{ steps.get-next-version.outputs.new-release-version }}
release-tag:
description: 'The new release tag'
value: ${{ steps.get-release-tag.outputs.release-tag }}
release-id:
description: 'The new release ID'
value: ${{ steps.get-release-id.outputs.result }}
Expand Down Expand Up @@ -55,6 +58,12 @@ runs:
run: 'npx semantic-release --branches main'
shell: bash

- name: Get release tag
id: get-release-tag
shell: bash
run: |
echo "release-tag=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_OUTPUT
- name: Get release ID
id: get-release-id
uses: actions/github-script@v7
Expand All @@ -64,6 +73,6 @@ runs:
const { data } = await github.rest.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag: "v${{ steps.get-next-version.outputs.new-release-version }}"
tag: "${{ steps.get-release-tag.outputs.release-tag }}"
})
return data.id
7 changes: 5 additions & 2 deletions .github/actions/publish-to-brew/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ inputs:
release-version:
description: 'The release version'
required: true
release-tag:
description: 'The release tag'
required: true

runs:
using: 'composite'
Expand All @@ -14,5 +17,5 @@ runs:
fail_on_unmatched_files: true
files: |
algokit-explorer_*.dmg
name: ${{ inputs.release-version }}
prerelease: ${{ contains(inputs.release-version, 'beta') }}
tag_name: ${{ inputs.release-tag }}
prerelease: ${{ contains(inputs.release-tag, 'beta') }}
7 changes: 5 additions & 2 deletions .github/actions/publish-to-snap/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ inputs:
artifact-name:
description: 'The name of the artifact zip file'
required: true
release-tag:
description: 'The release tag'
required: true

runs:
using: 'composite'
Expand Down Expand Up @@ -39,8 +42,8 @@ runs:
fail_on_unmatched_files: true
files: |
*.snap
name: ${{ inputs.release-version }}
prerelease: ${{ contains(inputs.release-version, 'beta') }}
tag_name: ${{ inputs.release-tag }}
prerelease: ${{ contains(inputs.release-tag, 'beta') }}

# once we have the release token, we will publish the snap to Snap Store
# - name: Set path to snap binary
Expand Down
7 changes: 5 additions & 2 deletions .github/actions/publish-to-winget/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ inputs:
release-version:
description: 'The release version'
required: true
release-tag:
description: 'The release tag'
required: true

runs:
using: 'composite'
Expand All @@ -14,5 +17,5 @@ runs:
fail_on_unmatched_files: true
files: |
algokit-explorer_*.msi
name: ${{ inputs.release-version }}
prerelease: ${{ contains(inputs.release-version, 'beta') }}
tag_name: ${{ inputs.release-tag }}
prerelease: ${{ contains(inputs.release-tag, 'beta') }}
4 changes: 4 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
outputs:
release-published: ${{ steps.create-release-action.outputs.release-published }}
release-version: ${{ steps.create-release-action.outputs.release-version }}
release-tag: ${{ steps.create-release-action.outputs.release-tag }}
release-id: ${{ steps.create-release-action.outputs.release-id }}

build-tauri:
Expand Down Expand Up @@ -143,14 +144,17 @@ jobs:
uses: ./.github/actions/publish-to-snap
with:
release-version: ${{ needs.create-release.outputs.release-version }}
release-tag: ${{ needs.create-release.outputs.release-tag }}
artifact-name: ${{ needs.build-tauri.outputs.linux-artifact-name }}

- name: Publish to Winget
uses: ./.github/actions/publish-to-winget
with:
release-version: ${{ needs.create-release.outputs.release-version }}
release-tag: ${{ needs.create-release.outputs.release-tag }}

- name: Publish to Brew
uses: ./.github/actions/publish-to-brew
with:
release-version: ${{ needs.create-release.outputs.release-version }}
release-tag: ${{ needs.create-release.outputs.release-tag }}

0 comments on commit cb6405a

Please sign in to comment.