Skip to content

Commit

Permalink
feat: upload pre-loaded balena images to DO spaces instead of Github …
Browse files Browse the repository at this point in the history
…on release
  • Loading branch information
luandro committed Mar 27, 2023
1 parent 9b17f24 commit 3d7cb14
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 5 deletions.
26 changes: 24 additions & 2 deletions .github/actions/release-images/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,37 @@ inputs:
repo_token:
required: true
description: "Github repository personal access token"
access_key:
required: true
description: "Digital Ocean spaces access key"
secret_key:
required: true
description: "Digital Ocean spaces secret key"
space_name:
required: true
description: "Digital Ocean spaces name"
space_region:
required: true
description: "Digital Ocean spaces region"
tag:
description: "The tag version of the release"
runs:
using: "composite"
steps:
- name: Download all workflow artifacts
uses: actions/download-artifact@v3
- uses: BetaHuhn/do-spaces-action@v2
with:
access_key: ${{ inputs.access_key}}
secret_key: ${{ inputs.secret_key }}
space_name: ${{ inputs.space_name }}
space_region: ${{ inputs.space_region }}
source: artifacts
out_dir: "releases_${{ inputs.tag }}"
- name: "✏️ Upload imgs and release"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ inputs.repo_token }}"
prerelease: ${{ inputs.pre-release }}
files: |
artifacts/*
# files: |
# artifacts/*
9 changes: 7 additions & 2 deletions .github/workflows/balena-tag-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,18 +67,23 @@ jobs:
balena_device: ${{ matrix.image }}
tag: ${{ needs.balena-deploy.outputs.github_tag }}

github-release:
github-images-release:
runs-on: ubuntu-latest
needs: [balena-deploy, balena-build-images]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Create Github pre-release
- name: Create Github release and upload images
uses: ./.github/actions/release-images
with:
pre-release: false
repo_token: "${{ secrets.PAT }}"
access_key: ${{ secrets.ACCESS_KEY}}
secret_key: ${{ secrets.SECRET_KEY }}
space_name: ${{ secrets.SPACE_NAME }}
space_region: ${{ secrets.SPACE_REGION }}
tag: ${{ needs.balena-deploy.outputs.github_tag }}

#TODO: Download and inject content into the image
# - name: Mount Image
Expand Down
2 changes: 1 addition & 1 deletion balena.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Earth Defender's Toolkit Offline"
type: "sw.application"
version: 0.4.5
version: 0.4.6
description: "A low-energy device that creates an access-point serving applications, bridging them and exposing curated content offline.
Software stack and content are automatically updated while online, and can be updated offline."
assets:
Expand Down

0 comments on commit 3d7cb14

Please sign in to comment.