Skip to content

Commit

Permalink
GitHub: Development.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gacko committed Jul 25, 2024
1 parent 1e01bae commit aed0758
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Release

on:
push:
branches:
- liljx

jobs:
get-releases:
name: Get releases
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get releases
id: get-releases
run: |
# Get releases.
releases="$(dirname azure/v*/release.yaml capa/v*/release.yaml)"
# Convert releases into JSON.
releases="$(echo "${releases}" | jq --raw-input --slurp 'split("\n")[:-1]' --compact-output)"
# Store releases.
echo releases="${releases}" >> "${GITHUB_OUTPUT}"
- name: Print releases
run: echo "${{ steps.get-releases.outputs.releases }}"

outputs:
releases: ${{ steps.get-releases.outputs.releases }}

print-release:
name: Print release
runs-on: ubuntu-latest
needs: get-releases

strategy:
matrix:
release: ${{ fromJSON(needs.get-releases.outputs.releases) }}

steps:
- name: Print release
env:
release: ${{ matrix.release }}
run: echo "${release}"
- name: Get provider
id: get-provider
env:
release: ${{ matrix.release }}
run: |
# Get provider.
provider="${release:h}"
# Switch release.
case "${provider}" in
capa)
provider="aws"
;;
esac
# Store provider.
echo provider="${provider}" >> "${GITHUB_OUTPUT}"
- name: Print provider
env:
provider: ${{ steps.get-provider.outputs.provider }}
run: echo "${provider}"

0 comments on commit aed0758

Please sign in to comment.