Create and push rockspec for moonlibs/kit #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create and push rockspec for moonlibs/kit | |
on: | |
workflow_run: | |
workflows: | |
- "Linting with luacheck" | |
- "Testing with unit tests" | |
types: | |
- completed | |
push: | |
tags: | |
- '*' | |
env: | |
ROCK_NAME: kit | |
jobs: | |
pack-and-push-tagged-rockspec: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} && startsWith(github.ref, 'refs/tags/') }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-tarantool | |
with: | |
only_tt: 'true' | |
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions | |
- name: Set env | |
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- run: tt rocks new_version --tag=${{ env.TAG }} ${{ env.ROCK_NAME }}-dev-1.rockspec ${{ env.TAG }} "git+https://github.com/${{ github.repository }}.git" | |
- run: tt rocks install ${{ env.ROCK_NAME }}-${{ env.TAG }}-1.rockspec | |
- run: tt rocks pack ${{ env.ROCK_NAME }}-${{ env.TAG }}-1.rockspec | |
- uses: unfor19/[email protected] | |
- run: | |
| | |
mkdir .build | |
cp ${{ env.ROCK_NAME }}-dev-1.rockspec ${{ env.ROCK_NAME }}-${{ env.TAG }}-1.rockspec \ | |
.build/ | |
cp *.src.rock .build/ | |
- name: rebuild and publish s3 luarocks server | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.MOONLIBS_S3_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.MOONLIBS_S3_SECRET_KEY}} | |
AWS_EC2_METADATA_DISABLED: true | |
run: | | |
cd .build && \ | |
aws s3 sync s3://moonlibs/ ./ && \ | |
tt rocks admin make_manifest . && \ | |
aws s3 sync --acl public-read ./ s3://moonlibs/; | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
prerelease: false | |
files: | | |
README.md | |
${{env.ROCK_NAME}}-dev-1.rockspec | |
${{env.ROCK_NAME}}-${{env.TAG}}-1.rockspec | |
${{env.ROCK_NAME}}-${{env.TAG}}-1.src.rock |