Some checks failed
Release Secrets Manager Action / build (push) Has been cancelled
52 lines
No EOL
1.5 KiB
YAML
52 lines
No EOL
1.5 KiB
YAML
name: Release Secrets Manager Action
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- v*
|
|
|
|
env:
|
|
build_name: action-secretsmanager
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
steps:
|
|
- name: 📤 Checkout source code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: ⚙️ Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: 1.24
|
|
|
|
- name: ⚙️ Install dependencies
|
|
run: |
|
|
apt-get -y -qq update && apt-get -qq -y install jq
|
|
|
|
- name: 👨🏻🔧 Build app
|
|
run: |
|
|
go build -o ${{ env.build_name }}
|
|
|
|
- name: 🤠 Create release
|
|
run: |
|
|
set -e
|
|
|
|
echo "Creating release for ${{ env.GITHUB_REPOSITORY}} with tag ${{ env.GITHUB_REF_NAME }}"
|
|
|
|
REQUEST=$(curl --request POST \
|
|
--url ${{ env.GITHUB_API_URL }}/repos/${{ env.GITHUB_REPOSITORY }}/releases \
|
|
--header 'Authorization: token ${{ secrets.GIT_TOKEN }}' \
|
|
--header 'content-type: application/json' \
|
|
--data '{ "tag_name": "${{ env.GITHUB_REF_NAME }}" }')
|
|
|
|
ls -lh ${{ env.build_name }}
|
|
|
|
RELEASE_ID=$(echo $REQUEST | jq .id)
|
|
|
|
echo "Uploading release asset for Release ID ${RELEASE_ID}"
|
|
|
|
curl --request POST \
|
|
--url ${{ env.GITHUB_API_URL }}/repos/${{ env.GITHUB_REPOSITORY }}/releases/${RELEASE_ID}/assets?name=${{ env.build_name }} \
|
|
--header 'Authorization: token ${{ secrets.GIT_TOKEN }}' \
|
|
-F 'attachment=@${{ env.build_name}}' |