name: CI on: [push, pull_request] jobs: test: name: Unit tests runs-on: ubuntu-18.04 steps: - name: Check out repository uses: actions/checkout@v2 - name: Run Tests run: | echo $(pwd) echo $(ls) docker pull nrel/openstudio:3.5.0 docker run --name test --rm -d -t -v $(pwd):/work -w /work nrel/openstudio:3.5.0 docker exec -t test pwd docker exec -t test ls docker exec -t test bundle update docker exec -t test bundle exec rake docker kill test deploy: name: Deploy to GitHub and Rubygems.org runs-on: ubuntu-latest needs: test if: github.ref == 'refs/heads/master' && github.repository_owner == 'ladybug-tools' steps: - uses: actions/checkout@v3 - name: set up node # we need node for for semantic release uses: actions/setup-node@v3.6.0 with: node-version: 14.17.0 - name: install semantic-release run: npm install @semantic-release/exec - name: run semantic release uses: cycjimmy/semantic-release-action@v3 id: semantic # Need an `id` for output variables env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Update gemspec if: steps.semantic.outputs.new_release_published == 'true' env: RELEASE_TAG: ${{ steps.semantic.outputs.new_release_version }} run: | export CLEAN_TAG=$(echo $RELEASE_TAG | sed 's/v//g') sed -i 's/"0.0.0"/'"'$CLEAN_TAG'"'/g' honeybee-openstudio.gemspec - name: Release Gem if: steps.semantic.outputs.new_release_published == 'true' uses: dawidd6/action-publish-gem@v1 with: api_key: ${{secrets.RUBYGEMS_API_KEY}} - name: Update lbt-grasshopper if: steps.semantic.outputs.new_release_published == 'true' env: RELEASE_TAG: ${{ steps.semantic.outputs.new_release_version }} DISPATCH_REPO: ladybug-tools/lbt-grasshopper DEPS_TOKEN: ${{ secrets.DEPS_UPDATING }} run: | curl -X POST https://api.github.com/repos/$DISPATCH_REPO/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ -d '{ "event_type": "honeybee_openstudio_gem_release", "client_payload": { "version" : "'$RELEASE_TAG'" } }' \ -u ladybugbot:$DEPS_TOKEN - name: Update honeybee-energy if: steps.semantic.outputs.new_release_published == 'true' env: RELEASE_TAG: ${{ steps.semantic.outputs.new_release_version }} DISPATCH_REPO: ladybug-tools/honeybee-energy DEPS_TOKEN: ${{ secrets.DEPS_UPDATING }} run: | curl -X POST https://api.github.com/repos/$DISPATCH_REPO/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ -d '{"event_type": "honeybee_openstudio_gem_release", "client_payload": {"version": "'$RELEASE_TAG'"}}' \ -u ladybugbot:$DEPS_TOKEN