Compare commits

...

3 Commits

Author SHA1 Message Date
Ivan Dyachkov e1d4234058 ci: fix ref_name 2024-02-01 17:53:29 +01:00
Ivan Dyachkov f737eaf1d5 ci: tmp patch to build linux packages only 2024-02-01 17:15:06 +01:00
Ivan Dyachkov ca0c46e0d5 ci: use v3 artifacts actions in build packages 2024-02-01 16:34:12 +01:00
1 changed files with 11 additions and 11 deletions

View File

@ -95,13 +95,12 @@ jobs:
apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }} apple_developer_identity: ${{ secrets.APPLE_DEVELOPER_IDENTITY }}
apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }} apple_developer_id_bundle: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE }}
apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }} apple_developer_id_bundle_password: ${{ secrets.APPLE_DEVELOPER_ID_BUNDLE_PASSWORD }}
- uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
if: success() if: success()
with: with:
name: ${{ matrix.profile }}-${{ matrix.otp }}-${{ matrix.os }} name: ${{ matrix.profile }}
path: _packages/${{ matrix.profile }}/ path: _packages/${{ matrix.profile }}/
retention-days: 7 retention-days: 7
compression-level: 0
linux: linux:
runs-on: [self-hosted, ephemeral, linux, "${{ matrix.arch }}"] runs-on: [self-hosted, ephemeral, linux, "${{ matrix.arch }}"]
@ -139,7 +138,7 @@ jobs:
with_elixir: with_elixir:
- 'no' - 'no'
include: include:
- profile: emqx - profile: ${{ inputs.profile }}
otp: ${{ inputs.otp_vsn }} otp: ${{ inputs.otp_vsn }}
arch: x64 arch: x64
os: ubuntu22.04 os: ubuntu22.04
@ -195,14 +194,13 @@ jobs:
fi fi
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with: with:
name: ${{ matrix.profile }}-${{ matrix.otp }}-${{ matrix.arch }}-${{ matrix.os }}-${{ matrix.with_elixir == 'yes' && 'elixir' || 'erlang' }} name: ${{ matrix.profile }}
path: _packages/${{ matrix.profile }}/ path: _packages/${{ matrix.profile }}/
retention-days: 7 retention-days: 7
publish_artifacts: publish_artifacts:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- mac
- linux - linux
if: inputs.publish == 'true' || inputs.publish if: inputs.publish == 'true' || inputs.publish
strategy: strategy:
@ -211,11 +209,10 @@ jobs:
profile: profile:
- ${{ inputs.profile }} - ${{ inputs.profile }}
steps: steps:
- uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 - uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with: with:
pattern: ${{ matrix.profile }}-* name: ${{ matrix.profile }}
path: packages/${{ matrix.profile }} path: packages/${{ matrix.profile }}
merge-multiple: true
- name: install dos2unix - name: install dos2unix
run: sudo apt-get update -y && sudo apt install -y dos2unix run: sudo apt-get update -y && sudo apt install -y dos2unix
- name: get packages - name: get packages
@ -236,6 +233,9 @@ jobs:
- name: upload to aws s3 - name: upload to aws s3
env: env:
PROFILE: ${{ matrix.profile }} PROFILE: ${{ matrix.profile }}
REF_NAME: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.ref || github.ref_name }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_CLOUDFRONT_ID: ${{ secrets.AWS_CLOUDFRONT_ID }}
run: | run: |
set -eu set -eu
if [ $PROFILE = 'emqx' ]; then if [ $PROFILE = 'emqx' ]; then
@ -246,5 +246,5 @@ jobs:
echo "unknown profile $PROFILE" echo "unknown profile $PROFILE"
exit 1 exit 1
fi fi
aws s3 cp --recursive packages/$PROFILE s3://${{ secrets.AWS_S3_BUCKET }}/$s3dir/${{ github.ref_name }} aws s3 cp --recursive packages/$PROFILE s3://$AWS_S3_BUCKET/$s3dir/$REF_NAME
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_ID }} --paths "/$s3dir/${{ github.ref_name }}/*" aws cloudfront create-invalidation --distribution-id "$AWS_CLOUDFRONT_ID" --paths "/$s3dir/$REF_NAME/*"