Skip to content

Commit

Permalink
Upload, first try
Browse files Browse the repository at this point in the history
  • Loading branch information
trasch committed Aug 7, 2024
1 parent a92b2d9 commit 85ec5fc
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions .github/workflows/homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,32 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Build executable for release
- name: Build the executable for release
run: swift build -c release --arch arm64 --arch x86_64 --product mvt
- name: Compress archive
- name: Compress the archive
run: tar -czf ${{ github.ref_name }}.tar.gz -C .build/apple/Products/Release mvt
- name: Release
uses: softprops/action-gh-release@v1
- name: Upload the release attachment
uses: actions/github-script@v7
with:
files: ${{ github.ref_name }}.tar.gz
token: ${{ secrets.GITHUB_TOKEN }}
script: |
console.log(context);
const fs = require('fs');
const tag = context.ref.replace("refs/tags/", "");
console.log("tag = ", tag);
// Get release for this tag
const release = await github.repos.getReleaseByTag({
owner: context.repo.owner,
repo: context.repo.repo,
tag
});
// Upload the release asset
await github.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: release.data.id,
name: `${tag}`.tar.gz,
data: await fs.readFileSync(`dist/mac/${tag}.tar.gz`)
})
- uses: mislav/bump-homebrew-formula-action@v3
with:
formula-name: mvt-tools
Expand Down

0 comments on commit 85ec5fc

Please sign in to comment.