Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
csjones committed Sep 10, 2023
1 parent 00bdb29 commit 18cc4b8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/check-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
name: Check GitHub Release
runs-on: macOS-13
env:
BINARY_NAME: lefthook
BINARY_REPO: evilmartians/lefthook
PLUGIN_REPO: gigabitcoin/template-plugin
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -25,8 +26,14 @@ jobs:
echo "PLUGIN_VERSION=$(echo $PLUGIN_RELEASE | grep -oE $SEMANTIC_VERSIONING_REGEX | head -n1)" >> $GITHUB_ENV
echo "BINARY_VERSION=$(echo $BINARY_RELEASE | grep -oE $SEMANTIC_VERSIONING_REGEX | head -n1)" >> $GITHUB_ENV
- name: Update GitHub Env Vars
run: |
# The example binary includes a leading 'v' in the release version number. We drop it on the next line.
echo "TRIMMED_BINARY_VERSION=$(echo $BINARY_VERSION | cut -c2-)" >> $GITHUB_ENV
- uses: ./.github/workflows/publish-artifact-bundle.yml
with:
plugin_version: ${{ env.PLUGIN_VERSION }}
binary_name: ${{ env.BINARY_NAME }}
binary_repo: ${{ env.BINARY_REPO }}
binary_version: ${{ env.BINARY_RELEASE }}
plugin_repo: ${{ env.PLUGIN_REPO }}
if: ${{ env.PLUGIN_VERSION == env.BINARY_VERSION }}
if: ${{ env.PLUGIN_VERSION == env.TRIMMED_BINARY_VERSION }}
18 changes: 11 additions & 7 deletions .github/workflows/publish-artifact-bundle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,32 @@ name: Publish Artifact Bundle
on:
workflow_call:
inputs:
binary_version:
binary_name:
required: true
type: string
binary_repo:
required: true
type: string
binary_name:
binary_version:
required: true
type: string
plugin_repo:
required: true
type: string

# Enables manually running this workflow from the Actions tab
workflow_dispatch:
inputs:
binary_version:
binary_name:
required: true
type: string
binary_repo:
required: true
type: string
binary_name:
binary_version:
required: true
type: string
plugin_repo:
required: true
type: string

Expand Down Expand Up @@ -71,18 +77,16 @@ jobs:
(cd ${{ inputs.binary_name }} && git reset --hard)
- name: Update Package.swift
run: |
echo ${{ hashFiles( env.ARTIFACT_NAME ) }}
sed -i '' 's/checksum: ".*"/checksum: "${{ hashFiles( env.ARTIFACT_NAME ) }}"/g' ${{ inputs.binary_name }}/Package.swift
sed -i '' -E "s/\/[0-9]+\.[0-9]+\.[0-9]+\//\/1.4.10\//" ${{ inputs.binary_name }}/Package.swift
cat ${{ inputs.binary_name }}/Package.swift
- name: Push Changes to GitHub
run: |
(cd ${{ inputs.binary_name }} && git commit -am "Updating ${{ inputs.binary_name }} to ${{ env.PLUGIN_VERSION }}" && git push origin)
- name: Create GitHub Release
run: |
echo $(cd ${{ inputs.binary_name }} && git rev-parse HEAD)
gh release create ${{ env.PLUGIN_VERSION }} \
-R "gigabitcoin/template-plugin" \
-R ${{ inputs.plugin_repo }} \
--target $(cd ${{ inputs.binary_name }} && git rev-parse HEAD) \
${{ env.ARTIFACT_NAME }}
env:
Expand Down

0 comments on commit 18cc4b8

Please sign in to comment.