Skip to content

Commit

Permalink
add github setup action
Browse files Browse the repository at this point in the history
  • Loading branch information
choffmeister committed Nov 30, 2022
1 parent 4067156 commit 218c1b5
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: 1.19.x
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: airfocusio
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Run GoReleaser
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,26 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
- uses: actions/setup-go@v3
with:
go-version: 1.19.x
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Log in to ghcr.io
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- run: make test
test-action:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: airfocusio/git-ops-update/setup@main
- name: Verify
run: git-ops-update version
- uses: airfocusio/git-ops-update/setup@main
with:
version: v0.4.0
- name: Verify
run: git-ops-update version
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,11 @@ jobs:
update:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: docker://ghcr.io/airfocusio/git-ops-update
- uses: airfocusio/git-ops-update/setup@main
- run: git-ops-update
```

## Installation
Expand Down
25 changes: 25 additions & 0 deletions setup/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Git Ops Update setup'
description: ''
inputs:
version:
description: 'version'
default: 'latest'
runs:
using: 'composite'
steps:
- if: inputs.version == 'latest'
run: |
cd /tmp
URL=$(curl -fsSL https://api.github.com/repos/airfocusio/git-ops-update/releases/${{ inputs.version }} | jq -r '.assets[] | select(.name|test("linux_amd64\\.tar\\.gz$")) | .browser_download_url')
curl -fsSL "$URL" | tar xz
mv git-ops-update /usr/local/bin
git-ops-update version
shell: bash
- if: inputs.version != 'latest'
run: |
cd /tmp
URL=$(curl -fsSL https://api.github.com/repos/airfocusio/git-ops-update/releases/tags/${{ inputs.version }} | jq -r '.assets[] | select(.name|test("linux_amd64\\.tar\\.gz$")) | .browser_download_url')
curl -fsSL "$URL" | tar xz
mv git-ops-update /usr/local/bin
git-ops-update version
shell: bash

0 comments on commit 218c1b5

Please sign in to comment.