fix: fix packages #18
This file contains hidden or 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
name: Build and Deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: ["main"] | |
jobs: | |
build: | |
environment: main | |
env: | |
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} | |
runs-on: ubuntu-latest | |
outputs: | |
latest_tag: ${{ steps.set_latest_tag.outputs.latest_tag }} | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Install musl cc | |
uses: awalsh128/cache-apt-pkgs-action@v1 | |
with: | |
packages: musl-tools musl-dev musl | |
- name: Setup Go with Caching | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: './go.mod' | |
cache: true | |
- name: Tag Version | |
id: tag_version | |
uses: mathieudutour/github-tag-action@v6.1 | |
with: | |
github_token: ${{ secrets.GH_ACCESS_TOKEN }} | |
release_branches: main | |
tag_prefix: v | |
# Removed Go modules cache step | |
- name: Configure Git for Private Repos | |
run: | | |
git config --global url.https://$GH_ACCESS_TOKEN@github.com/opengovern.insteadOf https://github.com/opengovern | |
- name: Build Local Task App | |
run: make local-build | |
- name: Pack Local Task Build | |
run: tar -cvf local.tar local | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: og-task-nve-lookup | |
path: ./local.tar | |
retention-days: 1 | |
- name: Set Latest Tag Output | |
id: set_latest_tag | |
run: | | |
if [[ -z "${{ steps.tag_version.outputs.new_tag }}" ]]; then | |
echo "latest_tag=${{ steps.tag_version.outputs.previous_tag }}" >> "$GITHUB_OUTPUT" | |
else | |
echo "latest_tag=${{ steps.tag_version.outputs.new_tag }}" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Build NVELookup Plugin App | |
working-directory: ./cloudql | |
run: make build | |
- name: Pack NVELookup Plugin Build | |
working-directory: ./cloudql | |
run: | | |
tar -cvf build.tar build | |
- name: Upload NVELookup Plugin Artifact | |
uses: actions/upload-artifact@v4.6.0 | |
with: | |
name: steampipe-plugin-nvelookup | |
path: ./cloudql/build.tar | |
retention-days: 1 | |
- name: Create output directory | |
working-directory: . | |
run: mkdir -p nvelookup-plugin | |
- name: Copy steampipe plugin to output directory | |
working-directory: . | |
run: cp ./cloudql/build/steampipe-plugin-nvelookup.plugin ./nvelookup-plugin/cloudql-plugin | |
- name: Pack output | |
working-directory: . | |
run: | | |
tar -czf nvelookup-plugin.tar nvelookup-plugin | |
- name: Upload nvelookup outputs artifact | |
uses: actions/upload-artifact@v4.6.0 | |
with: | |
name: nvelookup-plugins | |
path: ./nvelookup-plugin.tar | |
retention-days: 1 | |
deploy-task: | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: read | |
packages: write | |
environment: main | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: og-task-nve-lookup | |
path: . | |
- name: Unpack Task Artifact | |
run: tar -xvf local.tar | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to Container Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GHCR_PAT }} | |
- name: Build and Push Docker Image for Local Describer | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: | | |
ghcr.io/${{ github.repository_owner }}/og-task-nve-lookup:latest | |
ghcr.io/${{ github.repository_owner }}/og-task-nve-lookup:${{ needs.build.outputs.latest_tag }} | |
file: Dockerfile | |
context: . | |
release-task-plugin: | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
environment: main | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Download Integration Plugin Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: nvelookup-plugins | |
- name: Unpack Integration Plugin Artifact | |
run: | | |
tar -xvf nvelookup-plugin.tar | |
- name: Pack folder content into a zip file for release | |
run: | | |
cd nvelookup-plugin | |
zip -r nvelookup-plugin.zip . | |
- name: Release Integration Plugin | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: ./nvelookup-plugin/nvelookup-plugin.zip | |
tag_name: ${{ needs.build.outputs.latest_tag }} |