Skip to content

Commit

Permalink
update build config
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed Mar 20, 2023
1 parent 7f0f2fa commit 51c17d1
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 46 deletions.
6 changes: 6 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*Issue #, if available:*

*Description of changes:*


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
8 changes: 5 additions & 3 deletions .github/stale.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Configuration for probot-stale - https://github.com/probot/stale

# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
daysUntilStale: 120

# Number of days of inactivity before a stale issue is closed
daysUntilClose: 7
daysUntilClose: 14

# Issues with these labels will never be considered stale
exemptLabels:
- enhancement
- pinned
- security

Expand All @@ -18,7 +19,8 @@ staleLabel: wontfix
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed in 7 days if no further activity occurs.
Thank you for your contributions.
If the issue is still valid, please add a respective comment to prevent this
issue from being closed automatically. Thank you for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false
80 changes: 38 additions & 42 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Copyright 2019-2021 by Vegard IT GmbH, Germany, https://vegardit.com
# SPDX-FileCopyrightText: © Vegard IT GmbH (https://vegardit.com)
# SPDX-FileContributor: Sebastian Thomschke
# SPDX-License-Identifier: Apache-2.0
#
# Author: Sebastian Thomschke, Vegard IT GmbH
# SPDX-ArtifactOfProjectHomePage: https://github.com/vegardit/activemq-artemis-dynatrace-plugin
#
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions
name: Build

on:
push:
branches:
branches: # build all branches
- '**'
tags-ignore:
tags-ignore: # but don't build tags
- '**'
paths:
- '.github/workflows/build.yml'
Expand All @@ -21,6 +21,10 @@ on:
workflow_dispatch:
# https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/

defaults:
run:
shell: bash

jobs:

build:
Expand All @@ -30,53 +34,45 @@ jobs:
- name: Git Checkout
uses: actions/checkout@v3 #https://github.com/actions/checkout

- name: "Install: yq" # https://github.com/mikefarah/yq
shell: bash
run: |
set -eux
yq_version=$(curl -sSfL -o /dev/null -w "%{url_effective}\n" https://github.com/mikefarah/yq/releases/latest | grep -o '[^/]*$')
yq_download_url="https://github.com/mikefarah/yq/releases/download/$yq_version/yq_linux_amd64"
echo "Downloading [$yq_download_url]..."
mkdir /tmp/yq
curl -fsSL --retry 3 --retry-delay 5 -o /tmp/yq/yq "$yq_download_url"
chmod 777 /tmp/yq/yq
/tmp/yq/yq --version
echo "/tmp/yq" >> $GITHUB_PATH
- name: Setup yq
uses: vegardit/gha-setup-yq@v1

- name: Generate plugin zip files
run: |
DEBUG=1 bash build.sh
- name: Delete "latest" Release
if: github.ref == 'refs/heads/main'
- 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 }}
run: |
set -eux
set -eu
creds="${{ secrets.GH_API_TOKEN }}:x-oauth-basic"
api_base_url="$GITHUB_API_URL/repos/$GITHUB_REPOSITORY"
# delete release
latest_release_url="$api_base_url/releases/latest"
if curl -u $creds -fsLo /dev/null --head "$latest_release_url"; then
release_id=$(curl -u $creds -sL "$latest_release_url" | jq -r .id)
curl -u $creds -fsSL -X DELETE "$api_base_url/releases/$release_id"
# delete 'latest' github release
release_id=$(curl -fsL -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/$GITHUB_REPOSITORY/releases | jq -r '.[] | select(.name == "latest") | .id')
if [[ -n $release_id ]]; then
echo "Deleting release [$api_base_url/releases/$release_id]..."
curl -H "Authorization: token $GITHUB_TOKEN" -fsSL -X DELETE "$api_base_url/releases/$release_id"
fi
# delete tag
latest_tag_url="$api_base_url/git/refs/tags/latest"
if curl -u $creds -fsLo /dev/null --head "$latest_tag_url"; then
curl -u $creds -fsSL -u $creds -X DELETE "$latest_tag_url"
# delete 'latest' git tag
tag_url="$api_base_url/git/refs/tags/latest"
if curl -H "Authorization: token $GITHUB_TOKEN" -fsLo /dev/null --head "$tag_url"; then
echo "Deleting tag [$tag_url]..."
curl -H "Authorization: token $GITHUB_TOKEN" -fsSL -X DELETE "$tag_url"
fi
- name: Create "latest" Release
if: github.ref == 'refs/heads/main'
id: create_release
uses: ncipollo/release-action@v1
with:
artifacts: "work/artemis-overview-plugin-latest.zip,work/artemis-queues-plugin-latest.zip"
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false
tag: latest
- name: "Create 'latest' release"
if: ${{ github.ref_name == 'main' && !env.ACT }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eux
# https://hub.github.com/hub-release.1.html
hub release create "latest" \
--message "latest" \
--attach "work/artemis-overview-plugin-latest.zip" \
--attach "work/artemis-queues-plugin-latest.zip"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ActiveMQ Artemis plugins for Dynatrace

[![Build Status](https://img.shields.io/github/workflow/status/vegardit/activemq-artemis-dynatrace-plugin/Build)](https://github.com/vegardit/activemq-artemis-dynatrace-plugin/actions?query=workflow%3A%22Build%22)
[![Build](https://github.com/vegardit/activemq-artemis-dynatrace-plugin/actions/workflows/build.yml/badge.svg)](https://github.com/vegardit/activemq-artemis-dynatrace-plugin/actions/workflows/build.yml)
[![License](https://img.shields.io/github/license/vegardit/activemq-artemis-dynatrace-plugin.svg?label=license)](#license)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-v2.0%20adopted-ff69b4.svg)](CODE_OF_CONDUCT.md)

Expand Down

0 comments on commit 51c17d1

Please sign in to comment.