Skip to content

chore(develop): release 0.2.1 (#5) #34

chore(develop): release 0.2.1 (#5)

chore(develop): release 0.2.1 (#5) #34

Workflow file for this run

name: Skyetel
on:
push:
branches: "**"
tags: "v*"
defaults:
run:
working-directory: skyetel
jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-deployment-matrix.outputs.matrix }}
matrixLength: ${{ steps.set-deployment-matrix.outputs.matrixLength }}
steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
env:
BUNDLE_FROZEN: false
with:
working-directory: skyetel
bundler-cache: true
- name: Run the tests
run: bundle exec rake
- name: Set Deployment Matrix
id: set-deployment-matrix
run: |
branchName=$(echo '${{ github.ref }}' | sed 's,refs/heads/,,g')
matrixSource=$(cat << EOF
[
{
"environment": "staging",
"branch": "develop",
"release": false
},
{
"environment": "production",
"branch": "main",
"release": true
}
]
EOF
)
matrix=$(echo $matrixSource | jq --arg branchName "$branchName" 'map(. | select((.branch==$branchName)) )')
echo "matrix={\"include\":$(echo $matrix)}" >> $GITHUB_OUTPUT
echo "matrixLength=$(echo $matrix | jq length)" >> $GITHUB_OUTPUT
release:
name: Release
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: googleapis/release-please-action@v4
id: release-please
with:
token: ${{ secrets.SOMLENG_PERSONAL_ACCESS_TOKEN }}
path: skyetel
config-file: skyetel/release-please-config.json
manifest-file: skyetel/.release-please-manifest.json
build-packages:
name: Build Packages
runs-on: ubuntu-latest
needs:
- build
strategy:
matrix: ${{ fromJSON(needs.build.outputs.matrix) }}
if: needs.build.outputs.matrixLength > 0
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/somleng/somleng-skyetel
tags: |
type=ref,event=tag
type=raw,value=beta
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
push: true
context: skyetel
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
create-sentry-release:
name: Create Sentry Release
runs-on: ubuntu-latest
needs:
- build
- build-packages
if: ${{ startsWith(github.ref_name, 'v') }}
strategy:
matrix: ${{fromJSON(needs.build.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: somleng
SENTRY_PROJECT: somleng-skyetel
with:
environment: ${{ matrix.environment }}
version: ${{ github.ref_name }}