Skip to content

Commit

Permalink
#2 Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
rrusch committed Feb 23, 2024
1 parent 7bd02a7 commit 46a40b4
Show file tree
Hide file tree
Showing 2 changed files with 113 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/create-asset-on-release-published.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Release Asset"

on:
release:
types: [published]

jobs:
release:
name: "Create release asset"
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
token: ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
submodules: 'true'

- run: git log -1

- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

- name: Dump job context
env:
JOB_CONTEXT: ${{ toJson(job) }}
run: echo "$JOB_CONTEXT"

- name: "Build project"
id: zip_builder
run: |
zipfilename=${{ github.event.repository.name }}-v${{ github.event.release.tag_name }}.zip
echo "zipfilename=$zipfilename" >> $GITHUB_OUTPUT
zip -v -r "$zipfilename" . -x ".git/*" -x ".github/*" -x ".gitignore" -x ".gitmodules" -x ".pio/*" -x ".idea/*"
- name: "Release Asset"
uses: "softprops/action-gh-release@v1"
with:
tag_name: ${{ github.event.release.tag_name }}
files: |
${{ steps.zip_builder.outputs.zipfilename }}
67 changes: 67 additions & 0 deletions .github/workflows/release-on-milestone-closed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions

name: "Automatic Releases"

on:
milestone:
types:
- "closed"

jobs:
release:
name: "GIT tag, release & create merge-up PR"
runs-on: ubuntu-latest

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Release"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:release"
env:
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create Merge-Up Pull Request"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:create-merge-up-pull-request"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create and/or Switch to new Release Branch"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:switch-default-branch-to-next-minor"
env:
"GITHUB_TOKEN": ${{ secrets.ORGANIZATION_ADMIN_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Bump Changelog Version On Originating Release Branch"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:bump-changelog"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

- name: "Create new milestones"
uses: "laminas/automatic-releases@v1"
with:
command-name: "laminas:automatic-releases:create-milestones"
env:
"GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }}
"SIGNING_SECRET_KEY": ${{ secrets.SIGNING_SECRET_KEY }}
"GIT_AUTHOR_NAME": ${{ secrets.GIT_AUTHOR_NAME }}
"GIT_AUTHOR_EMAIL": ${{ secrets.GIT_AUTHOR_EMAIL }}

0 comments on commit 46a40b4

Please sign in to comment.