fix bottle upload #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Forked from https://github.com/dawidd6/homebrew-test-tap-new/blob/main/.github/workflows/tests.yml | |
name: brew test-bot | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
test-bot: | |
strategy: | |
matrix: | |
os: [macOS-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Set up Homebrew | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Cache Homebrew Bundler RubyGems | |
id: cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ steps.set-up-homebrew.outputs.gems-path }} | |
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }} | |
restore-keys: ${{ runner.os }}-rubygems- | |
- name: Install Homebrew Bundler RubyGems | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: brew install-bundler-gems | |
- run: brew style Formula/* | |
- run: brew test-bot --only-cleanup-before Formula/* | |
- run: brew test-bot --only-setup Formula/* | |
- run: brew test-bot --only-tap-syntax | |
- run: brew test-bot --only-formulae Formula/aoflagger.rb Formula/birli.rb | |
- name: Get version number from current date | |
run: echo "DATE=$(date +'v%Y.%m.%d.%H.%M')" | tee -a "$GITHUB_ENV" | |
- name: get archive names | |
id: archive_names | |
run: | | |
for package in aoflagger birli; do | |
brew install --build-bottle Formula/$package.rb | |
brew bottle --json Formula/$package.rb | |
echo "${package}_path=$(ls ${package}--*.bottle*.tar.gz)" | tee -a "$GITHUB_ENV" | |
done | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
with: | |
tag_name: ${{ env.DATE }} | |
release_name: Release ${{ env.DATE }} | |
body: | | |
Brew bottles for casacore / aoflagger | |
draft: false | |
prerelease: false | |
- name: Upload Aoflagger Release Asset | |
uses: actions/upload-release-asset@v1 | |
continue-on-error: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.aoflagger_path }} | |
asset_name: ${{ env.aoflagger_path }} | |
asset_content_type: application/gzip | |
- name: Upload Birli Release Asset | |
uses: actions/upload-release-asset@v1 | |
continue-on-error: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ env.birli_path }} | |
asset_name: ${{ env.birli_path }} | |
asset_content_type: application/gzip |