Skip to content

build: replace hub command with gh #62

build: replace hub command with gh

build: replace hub command with gh #62

Workflow file for this run

# SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com)
# SPDX-FileContributor: Sebastian Thomschke
# SPDX-License-Identifier: Apache-2.0
# SPDX-ArtifactOfProjectHomePage: https://github.com/vegardit/activemq-artemis-dynatrace-plugin
#
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
name: Build
on:
push:
branches-ignore: # build all branches except:
- 'dependabot/**' # prevent GHA triggered twice (once for commit to the branch and once for opening/syncing the PR)
tags-ignore: # don't build tags
- '**'
paths:
- '.github/workflows/build.yml'
- '**/plugin.yaml'
pull_request:
paths:
- '**/plugin.yaml'
workflow_dispatch:
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4 # https://github.com/actions/checkout
- name: Setup yq
uses: vegardit/gha-setup-yq@v1
- name: Generate plugin zip files
run: |
DEBUG=1 bash build.sh
- name: "Delete previous 'latest' release"
if: ${{ github.ref_name == 'main' && !env.ACT }} # https://github.com/nektos/act#skipping-steps
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: latest
# https://cli.github.com/manual/gh_release_delete
run: |
GH_DEBUG=1 gh release delete "$RELEASE_NAME" --yes --cleanup-tag || true
- name: "Create 'latest' release"
if: ${{ github.ref_name == 'main' && !env.ACT }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: latest
# https://cli.github.com/manual/gh_release_create
run: |
GH_DEBUG=1 gh release create "$RELEASE_NAME" \
--prerelease \
--latest \
--notes "${{ github.event.head_commit.message }}" \
--target "${{ github.sha }}" \
work/artemis-overview-plugin-latest.zip \
work/artemis-queues-plugin-latest.zip