Skip to content

Commit

Permalink
Various cleanups to our github action setup (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mpdreamz committed Mar 1, 2023
1 parent 35a49c2 commit e24402b
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 124 deletions.
13 changes: 0 additions & 13 deletions .ci/deploy.bat

This file was deleted.

11 changes: 0 additions & 11 deletions .ci/deploy.sh

This file was deleted.

File renamed without changes.
20 changes: 20 additions & 0 deletions .github/workflows/bootstrap/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Bootstrap Checkout
description: Ensures an action that needs to build has access to git tags

runs:
using: "composite"
steps:
# Ensure we fetch all tags
- shell: bash
run: |
git fetch --prune --unshallow --tags
git tag --list
# Install .NET version as mandated by global.json
- uses: actions/setup-dotnet@v3
with:
global-json-file: global.json

# Setup git config
- uses: elastic/apm-pipeline-library/.github/actions/setup-git@current
23 changes: 0 additions & 23 deletions .github/workflows/docker-run/action.yml

This file was deleted.

27 changes: 8 additions & 19 deletions .github/workflows/release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

permissions:
contents: read
packages: write

env:
DOTNET_VERSION: '6.0.400'
Expand All @@ -16,26 +17,17 @@ jobs:

steps:
- uses: actions/checkout@v3

- uses: elastic/apm-pipeline-library/.github/actions/setup-git@current

- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap
- name: Generate local nuget packages
uses: ./.github/workflows/docker-run
with:
dotnet-sdk-version: ${{ env.DOTNET_VERSION }}
command: ./build.sh generatepackages -s true
run: ./build.sh generatepackages -s true

- name: Validate *.npkg files that were created
uses: ./.github/workflows/docker-run
with:
dotnet-sdk-version: ${{ env.DOTNET_VERSION }}
command: ./build.sh validatepackages -s true
run: ./build.sh validatepackages -s true

- name: Inspect public API change
uses: ./.github/workflows/docker-run
with:
dotnet-sdk-version: ${{ env.DOTNET_VERSION }}
command: ./build.sh generateapichanges -s true
run: ./build.sh generateapichanges -s true

- name: Prepare feedz.io
uses: hashicorp/[email protected]
Expand All @@ -49,10 +41,7 @@ jobs:
secret/apm-team/ci/elastic-observability-feedz.io url | REPO_API_URL
- name: Release to feedz.io
uses: ./.github/workflows/docker-run
with:
dotnet-sdk-version: ${{ env.DOTNET_VERSION }}
command: .ci/deploy.sh ${REPO_API_KEY} ${REPO_API_URL}
- run: dotnet nuget push 'build/output/*.nupkg' -k ${REPO_API_KEY} -s ${REPO_API_URL} --skip-duplicate --no-symbols

- name: publish canary packages github package repository
shell: bash
Expand Down
47 changes: 9 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,55 +10,29 @@ permissions:
contents: write
issues: write

env:
DOTNET_VERSION: '6.0.400'

jobs:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: elastic/apm-pipeline-library/.github/actions/setup-git@current

- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap

- name: Generate local nuget packages
uses: ./.github/workflows/docker-run
with:
dotnet-sdk-version: ${{ env.DOTNET_VERSION }}
command: ./build.sh generatepackages -s true
run: ./build.sh generatepackages -s true

- name: Validate *.npkg files that were created
uses: ./.github/workflows/docker-run
with:
dotnet-sdk-version: ${{ env.DOTNET_VERSION }}
command: ./build.sh validatepackages -s true
run: ./build.sh validatepackages -s true

- name: Inspect public API change
uses: ./.github/workflows/docker-run
with:
dotnet-sdk-version: ${{ env.DOTNET_VERSION }}
command: ./build.sh generateapichanges -s true
run: ./build.sh generateapichanges -s true

- name: Generate release notes
uses: ./.github/workflows/docker-run
with:
dotnet-sdk-version: ${{ env.DOTNET_VERSION }}
command: ./build.sh generatereleasenotes -s true --token ${{ secrets.GITHUB_TOKEN }}

- name: Inspect public API change
uses: ./.github/workflows/docker-run
with:
dotnet-sdk-version: ${{ env.DOTNET_VERSION }}
command: ./build.sh generateapichanges -s true
run: ./build.sh generatereleasenotes -s true --token ${{ secrets.GITHUB_TOKEN }}

- name: Create or update release for tag on github
uses: ./.github/workflows/docker-run
with:
dotnet-sdk-version: ${{ env.DOTNET_VERSION }}
command: ./build.sh createreleaseongithub -s true --token ${{ secrets.GITHUB_TOKEN }}
run: ./build.sh createreleaseongithub -s true --token ${{ secrets.GITHUB_TOKEN }}

- name: Prepare Nuget
uses: hashicorp/[email protected]
Expand All @@ -72,10 +46,7 @@ jobs:
secret/apm-team/ci/elastic-observability-nuget url | REPO_API_URL
- name: Release to Nuget
uses: ./.github/workflows/docker-run
with:
dotnet-sdk-version: ${{ env.DOTNET_VERSION }}
command: .ci/deploy.sh ${REPO_API_KEY} ${REPO_API_URL}
run: dotnet nuget push 'build/output/*.nupkg' -k ${REPO_API_KEY} -s ${REPO_API_URL} --skip-duplicate --no-symbols

- if: ${{ success() }}
uses: elastic/apm-pipeline-library/.github/actions/slack-message@current
Expand Down
32 changes: 13 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

env:
# This is the version to be used for both OS platforms (windows and linux)
DOTNET_VERSION: '6.0.400'
ELASTIC_STACK_VERSION: '8.4.0'

jobs:
Expand All @@ -34,13 +32,8 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-dotnet@v1
with:
dotnet-version: |
${{ env.DOTNET_VERSION }}
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap

- uses: actions/cache@v3
with:
Expand All @@ -54,12 +47,16 @@ jobs:
path: ~\AppData\Local\ElasticManaged\elasticsearch-${{ env.ELASTIC_STACK_VERSION }}
key: ${{ runner.os }}-elastic-managed-${{ env.ELASTIC_STACK_VERSION }}

- name: Run test
run: build.bat test
- name: Build the solution
run: build.bat build -s true
shell: cmd

- name: Run tests
run: build.bat test -s true
shell: cmd

- name: Run integration tests
run: build.bat integrate
run: build.bat integrate -s true
shell: cmd

- name: Store test results
Expand All @@ -74,14 +71,11 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Bootstrap Action Workspace
uses: ./.github/workflows/bootstrap

- name: Run release -c false within the docker container
uses: ./.github/workflows/docker-run
with:
dotnet-sdk-version: ${{ env.DOTNET_VERSION }}
command: ./build.sh release -c false
- name: Run release -c false
run: ./build.sh release -c false --token ${{ secrets.GITHUB_TOKEN }}

- name: Store test results
if: success() || failure()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
vaultUrl: ${{ secrets.VAULT_ADDR }}
vaultRoleId: ${{ secrets.VAULT_ROLE_ID }}
vaultSecretId: ${{ secrets.VAULT_SECRET_ID }}
pipeline: ./.ci/update-specs.yml
pipeline: ./.github/update-specs.yml

0 comments on commit e24402b

Please sign in to comment.