feat: STACKIT Secrets Manager Action
Some checks failed
Release Secrets Manager Action / build (push) Has been cancelled
Some checks failed
Release Secrets Manager Action / build (push) Has been cancelled
This commit is contained in:
commit
cc0c27a4e9
9 changed files with 401 additions and 0 deletions
52
.forgejo/workflows/release.yml
Normal file
52
.forgejo/workflows/release.yml
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
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}}'
|
||||
Loading…
Add table
Add a link
Reference in a new issue