Merge pull request #271 from jumppad-labs/f-plugins #738
Workflow file for this run
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
--- | |
name: Build And Deploy | |
on: [push] | |
jobs: | |
dagger_build: | |
name: Dagger Build and Test | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set keys | |
run: | | |
echo "${{secrets.QUILL_SIGN_P12}}" | base64 -d > ./cert.p12 | |
echo "${{secrets.QUILL_NOTORY_KEY}}" > ./key.p8 | |
echo "QUILL_SIGN_PASSWORD=${{secrets.QUILL_SIGN_PASSWORD}}" >> $GITHUB_ENV | |
echo "GITHUB_TOKEN=${{secrets.GH_TOKEN}}" >> $GITHUB_ENV | |
- name: All | |
uses: dagger/dagger-for-github@v5 | |
with: | |
verb: call | |
module: ./.dagger | |
args: all --output=./output --src=. --github-token=GITHUB_TOKEN --notorize-cert=./cert.p12 --notorize-cert-password=QUILL_SIGN_PASSWORD --notorize-key=./key.p8 --notorize-id=${{secrets.QUILL_NOTARY_KEY_ID}} --notorize-issuer=${{secrets.QUILL_NOTARY_ISSUER}} | |
version: "0.9.9" | |
cloud-token: ${{ secrets.DAGGER_TOKEN }} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: archives | |
path: | | |
./output | |
- name: Send status to Discord | |
uses: sarisia/actions-status-discord@v1 | |
if: always() | |
with: | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
tile: ${{ github.job_id }} | |
description: "Build application" | |
functional_test_docker: | |
name: Test Docker | |
runs-on: ubuntu-latest | |
needs: dagger_build | |
strategy: | |
max-parallel: 2 | |
fail-fast: false | |
matrix: | |
folder: [ | |
'./examples/container', | |
'./examples/build', | |
'./examples/docs', | |
'./examples/nomad', | |
'./examples/single_k3s_cluster', | |
'./examples/multiple_k3s_clusters', | |
'./examples/exec', | |
'./examples/certificates', | |
'./examples/terraform', | |
'./examples/registries', | |
] | |
steps: | |
- name: Download-Binaries | |
uses: actions/download-artifact@v2 | |
with: | |
name: archives | |
path: ./build_artifacts | |
- name: Install binary executable | |
run: | | |
cp $(find ./build_artifacts -name "jumppad_*_linux_x86_64.tar.gz" -type f) ./build_artifacts/jumppad.tar.gz | |
sudo tar -xzf ./build_artifacts/jumppad.tar.gz | |
sudo mv ./jumppad /usr/local/bin/jumppad | |
sudo chmod +x /usr/local/bin/jumppad | |
- uses: actions/checkout@v2 | |
- name: Run tests | |
run: | | |
jumppad check --non-interactive | |
jumppad purge --non-interactive | |
jumppad test --non-interactive ${{matrix.folder}} | |
- name: Send status to Discord | |
uses: sarisia/actions-status-discord@v1 | |
if: always() | |
with: | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
tile: ${{ github.job_id }} | |
description: "Functional tests for docker: ${{matrix.folder}}" | |
functional_test_podman: | |
name: Test Podman | |
runs-on: ubuntu-latest | |
needs: dagger_build | |
strategy: | |
max-parallel: 2 | |
fail-fast: false | |
matrix: | |
folder: [ | |
'./examples/container', | |
'./examples/build', | |
'./examples/docs', | |
'./examples/nomad', | |
'./examples/single_k3s_cluster', | |
'./examples/multiple_k3s_clusters', | |
'./examples/exec', | |
] | |
steps: | |
- name: Download-Binaries | |
uses: actions/download-artifact@v2 | |
with: | |
name: archives | |
path: ./build_artifacts | |
- name: Install binary executable | |
run: | | |
cp $(find ./build_artifacts -name "jumppad_*_linux_x86_64.tar.gz" -type f) ./build_artifacts/jumppad.tar.gz | |
sudo tar -xzf ./build_artifacts/jumppad.tar.gz | |
sudo mv ./jumppad /usr/local/bin/jumppad | |
sudo chmod +x /usr/local/bin/jumppad | |
- uses: actions/checkout@v2 | |
- name: Install dependencies for Podman tests | |
run: | | |
sudo mkdir -p /etc/apt/keyrings | |
# Debian Testing/Bookworm | |
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Testing/Release.key \ | |
| gpg --dearmor \ | |
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\ | |
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Testing/ /" \ | |
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null | |
# Debian Unstable/Sid | |
curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Unstable/Release.key \ | |
| gpg --dearmor \ | |
| sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null | |
echo \ | |
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\ | |
https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/Debian_Unstable/ /" \ | |
| sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null | |
# Install Podman | |
sudo apt-get update | |
sudo apt-get -y upgrade | |
sudo apt-get -y install podman | |
# Start the Podman sock | |
sudo nohup podman system service -t 0 > ./podman.log & | |
sleep 10 | |
sudo chmod +x /run/podman | |
sudo chmod 777 /run/podman/podman.sock | |
- name: Run tests | |
run: | | |
jumppad check --non-interactive | |
jumppad purge --non-interactive | |
jumppad test --non-interactive ${{matrix.folder}} | |
env: | |
DOCKER_HOST: "unix:///run/podman/podman.sock" | |
- name: Send status to Discord | |
uses: sarisia/actions-status-discord@v1 | |
if: always() | |
with: | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
tile: ${{ github.job_id }} | |
description: "Functional tests for ${{matrix.folder}}" | |
github_release: | |
name: Create GitHub Release | |
if: ${{ github.ref == 'refs/heads/main' }} | |
needs: | |
- dagger_build | |
environment: | |
name: release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set keys | |
run: | | |
echo "GITHUB_TOKEN=${{secrets.GH_TOKEN}}" >> $GITHUB_ENV | |
- uses: actions/checkout@v2 | |
- name: Download-Binaries | |
uses: actions/download-artifact@v2 | |
with: | |
name: archives | |
path: ./build_artifacts | |
- name: Release | |
uses: dagger/dagger-for-github@v5 | |
with: | |
verb: call | |
module: ./.dagger | |
args: release --src=. --github-token=GITHUB_TOKEN --archives=./build_artifacts --output=./version.txt | |
version: "0.9.9" | |
cloud-token: ${{ secrets.DAGGER_TOKEN }} | |
- name: Set output | |
id: setoutput | |
run: | | |
echo "version=$(cat ./version.txt)" >> $GITHUB_OUTPUT | |
outputs: | |
version: ${{ steps.setoutput.outputs.version }} | |
brew: | |
name: Release to HomeBrew | |
needs: | |
- github_release | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
repository: 'jumppad-labs/homebrew-repo' | |
token: '${{ secrets.GH_TOKEN }}' | |
- name: Configure Git | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "Jumppad Bot" | |
git pull origin main | |
- name: Generate HomeBrew config | |
run: | | |
export VERSION=${{ needs.github_release.outputs.version }} | |
export DARWIN_ARM64_SHA=$(sha256sum ./releases/jumppad${{ needs.github_release.outputs.version }}_darwin_arm64.zip | cut -d " " -f 1) | |
export DARWIN_x86_SHA=$(sha256sum ./releases/jumppad_${{ needs.github_release.outputs.version }}_darwin_x86_64.zip | cut -d " " -f 1) | |
export LINUX_ARM64_SHA=$(sha256sum ./releases/jumppad_${{ needs.github_release.outputs.version }}_linux_arm64.tar.gz | cut -d " " -f 1) | |
export LINUX_x86_SHA=$(sha256sum ./releases/jumppad_${{ needs.github_release.outputs.version }}_linux_x86_64.tar.gz | cut -d " " -f 1) | |
cat <<- EOF > ./jumppad.rb | |
# typed: false | |
# frozen_string_literal: true | |
class Jumppad < Formula | |
desc "" | |
homepage "https://jumppad.dev/" | |
version "${VERSION}" | |
if OS.mac? && Hardware::CPU.intel? | |
url "https://github.com/jumppad-labs/jumppad/releases/download/${VERSION}/jumppad_${VERSION}_darwin_x86_64.zip" | |
sha256 "${DARWIN_x86_SHA}" | |
end | |
if OS.mac? && Hardware::CPU.arm? | |
url "https://github.com/jumppad-labs/jumppad/releases/download/${VERSION}/jumppad_${VERSION}_darwin_arm64.zip" | |
sha256 "${DARWIN_ARM64_SHA}" | |
end | |
if OS.linux? && Hardware::CPU.intel? | |
url "https://github.com/jumppad-labs/jumppad/releases/download/${VERSION}/jumppad_${VERSION}_linux_x86_64.tar.gz" | |
sha256 "${LINUX_x86_SHA}" | |
end | |
if OS.linux? && Hardware::CPU.arm? && Hardware::CPU.is_64_bit? | |
url "https://github.com/jumppad-labs/jumppad/releases/download/${VERSION}/jumppad_${VERSION}_linux_arm64.tar.gz" | |
sha256 "${LINUX_ARM64_SHA}" | |
end | |
def install | |
bin.install "jumppad" | |
end | |
end | |
EOF | |
cat ./jumppad.rb | |
rm -rf ./dist | |
- name: Push update | |
run: | | |
git add . | |
git commit -m "Update version to ${{ needs.github_release.outputs.version }}" | |
git push | |
winget: | |
name: Publish to WinGet | |
needs: | |
- github_release | |
runs-on: windows-latest | |
steps: | |
- uses: jumppad-labs/[email protected] | |
with: | |
publish-type: "Update" | |
user: "jumppad" | |
package: "jumppad" | |
version: ${{ needs.github_release.outputs.version }} | |
url: "https://github.com/jumppad-labs/jumppad/releases/download/${{ needs.github_release.outputs.version }}/jumppad_${{ needs.github_release.outputs.version }}_windows_x86_64.zip|x64" | |
token: '${{ secrets.GH_TOKEN }}' | |
- name: Send status to Discord | |
uses: sarisia/actions-status-discord@v1 | |
if: always() | |
with: | |
tile: ${{ github.job_id }} | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
description: "Push new version ${{ needs.github_release.outputs.version }} to Winget" | |
apt: | |
name: Update fury.io Apt repository | |
needs: | |
- github_release | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
arch: ["amd64.deb", "arm64.deb"] | |
steps: | |
- name: Download release | |
run: | | |
wget "https://github.com/jumppad-labs/jumppad/releases/download/${{ needs.github_release.outputs.version }}/jumppad_${{ needs.github_release.outputs.version }}_linux_${{ matrix.arch }}" | |
- name: Upload release | |
run: | | |
curl -F package=@jumppad_${{ needs.github_release.outputs.version }}_linux_${{ matrix.arch }} https://${{ secrets.FURY_JUMPPAD_TOKEN }}@push.fury.io/jumppad/ | |
- name: Send status to Discord | |
uses: sarisia/actions-status-discord@v1 | |
if: always() | |
with: | |
tile: ${{ github.job_id }} | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
description: "Push new version ${{ needs.github_release.outputs.version }} to Apt" | |
update_website: | |
name: Update Jumppad website with latest version | |
needs: | |
- github_release | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
repository: 'jumppad-labs/jumppad-labs.github.io' | |
token: '${{ secrets.GH_TOKEN }}' | |
- name: Configure Git | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "Jumppad Bot" | |
- name: Write version | |
run: | | |
echo "${{ needs.github_release.outputs.version }}" > ./public/latest | |
- name: Push update | |
run: | | |
git add . | |
git commit -m "Update version to ${{ needs.github_release.outputs.version }}" | |
git push | |
- name: Send status to Discord | |
uses: sarisia/actions-status-discord@v1 | |
if: always() | |
with: | |
tile: ${{ github.job_id }} | |
webhook: ${{ secrets.DISCORD_WEBHOOK }} | |
description: "Update website with latest version ${{ needs.github_release.outputs.version }}" |