Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feat/binary'
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Rios <[email protected]>
  • Loading branch information
rios0rios0 committed Feb 9, 2024
2 parents ffabc22 + 0ceeaa9 commit 9ca78e0
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/go-binary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
name: 'delivery > binary'
runs-on: 'ubuntu-latest'
steps:
- uses: 'rios0rios0/pipelines/github/global/stages/40-delivery/deb-releaser@main'
- uses: 'rios0rios0/pipelines/github/global/stages/40-delivery/binary@main'
with:
binary_name: '${{ env.BINARY_NAME }}'
needs: [ 'delivery-release' ]
if: "(github.event_name == 'push' && github.ref == 'refs/heads/main') || startsWith(github.ref, 'refs/tags/')"
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Exceptions are acceptable depending on the circumstances (critical bug fixes tha
- added a new step to replace the environment variables contained inside the `yaml` file
- added a script into the Golang `delivery` to get the new `siteName` variable
- added the code check step for GoLang inside the GitHub Actions provider - [#19](https://github.com/rios0rios0/pipelines/issues/19)
- added the binary release feature for GoLang pipelines

### Changed

Expand Down
33 changes: 32 additions & 1 deletion github/global/stages/40-delivery/binary/action.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
on:
workflow_call:

inputs:
binary_name:
description: 'Binary name to be used as default source'
required: true

runs:
using: 'composite'
env:
PACKAGE_NAME: '${{ inputs.binary_name }}-${{ github.ref[10:] }}'
DEBIAN_FRONTEND: 'noninteractive'
steps:
# TODO: it should be finished with: "https://github.com/rios0rios0/autobump/blob/main/.github/workflows/release.yml#L68"
- run: |
make build
strip -s bin/${{ inputs.binary_name }}
shell: 'bash'
- run: |
cd bin
zip -9 ${{ env.PACKAGE_NAME }}.zip ${{ inputs.binary_name }}
shell: 'bash'
- uses: 'actions/upload-artifact@v2'
with:
name: '${{ inputs.binary_name }}'
path: 'bin/${{ env.PACKAGE_NAME }}.zip'
- uses: 'actions/download-artifact@v2'
with:
name: '${{ inputs.binary_name }}'
- uses: 'actions/upload-release-asset@v1'
# TODO: is this really necessary?
#env:
# GITHUB_TOKEN: '${{ github.token }}'
with:
upload_url: '${{ steps.create_release.outputs.upload_url }}'
asset_path: '${{ env.PACKAGE_NAME }}.zip'
asset_name: '${{ env.PACKAGE_NAME }}.zip'
asset_content_type: 'application/zip'
2 changes: 1 addition & 1 deletion github/global/stages/40-delivery/release/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
runs:
using: 'composite'
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
upload_url: '${{ steps.create_release.outputs.upload_url }}'
steps:
- id: 'create_release'
uses: 'softprops/action-gh-release@v1'
Expand Down

0 comments on commit 9ca78e0

Please sign in to comment.