Merge pull request #28 from inloco/dependabot/go_modules/filippo.io/a… #89
This file contains 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
on: | |
- push | |
jobs: | |
build: | |
name: Build | |
strategy: | |
matrix: | |
platform: | |
- macos-latest | |
- ubuntu-latest | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- name: Set up Go 1.22 | |
uses: actions/[email protected] | |
with: | |
go-version: "1.22" | |
id: go | |
- name: Check out code into the Go module directory | |
uses: actions/[email protected] | |
- name: Make | |
run: make continuous-integration | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ runner.os }} | |
path: plugin | |
release: | |
name: Release | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
if: startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '.') | |
outputs: | |
upload-url: ${{ steps.create_release.outputs.upload_url }} | |
steps: | |
- name: Create Release | |
uses: actions/[email protected] | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
publish-plugin: | |
name: Publish Plugin | |
needs: release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
strategy: | |
matrix: | |
os: | |
- name: macOS | |
kernel: darwin | |
- name: Linux | |
kernel: linux | |
steps: | |
- name: Download ${{ matrix.os.name }} Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ matrix.os.name }} | |
- name: Upload ${{ matrix.os.name }} Release Asset | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload-url }} | |
asset_path: ./${{ matrix.os.name }}/plugin | |
asset_name: plugin-${{ matrix.os.kernel }}-amd64 | |
asset_content_type: application/octet-stream | |
publish-script: | |
name: Publish Script | |
needs: | |
- release | |
- publish-plugin | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Check out code into directory | |
uses: actions/[email protected] | |
- name: Update Git Tag | |
run: sed "s/v0.0.0/${GITHUB_REF##*/}/g" -i ./hack/install.sh | |
- name: Upload script Release Asset | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.release.outputs.upload-url }} | |
asset_path: ./hack/install.sh | |
asset_name: install.sh | |
asset_content_type: text/x-shellscript |