Browse Source

Github actions: Remove git-branch-name action

Github provides a `github.ref_name` variable that contains the branch
name:

"The short ref name of the branch or tag that triggered the workflow
run. This value matches the branch or tag name shown on GitHub. For
example, feature-branch-1."

https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
QGC4.4
Philipp Borgers 2 years ago committed by Beat Küng
parent
commit
403b9400b4
  1. 12
      .github/workflows/android_release.yml
  2. 7
      .github/workflows/linux_release.yml
  3. 7
      .github/workflows/macos_release.yml
  4. 7
      .github/workflows/windows_release.yml

12
.github/workflows/android_release.yml

@ -99,16 +99,10 @@ jobs:
mkdir gstreamer-1.0-android-universal-1.18.5 mkdir gstreamer-1.0-android-universal-1.18.5
tar xf gstreamer-1.0-android-universal-1.18.5.tar.xz -C gstreamer-1.0-android-universal-1.18.5 tar xf gstreamer-1.0-android-universal-1.18.5.tar.xz -C gstreamer-1.0-android-universal-1.18.5
# This will set GIT_BRANCH_NAME environment variable
- name: Git branch name
id: git-branch-name
uses: EthanSK/git-branch-name-action@v1
- name: Update android manifest - name: Update android manifest
if: github.ref_name != 'Stable'
run: | run: |
if [ $GIT_BRANCH_NAME != "Stable*" ]; then ${SOURCE_DIR}/tools/update_android_manifest_package.sh ${{ github.ref_name }}
${SOURCE_DIR}/tools/update_android_manifest_package.sh ${GIT_BRANCH_NAME}
fi
- name: Build - name: Build
working-directory: ${{ runner.temp }}/shadow_build_dir working-directory: ${{ runner.temp }}/shadow_build_dir
@ -137,7 +131,7 @@ jobs:
run: | run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws s3 cp ${{ matrix.ARTIFACT }} s3://qgroundcontrol/builds/${GIT_BRANCH_NAME}/${{ matrix.ARTIFACT }} --region us-west-2 --acl public-read aws s3 cp ${{ matrix.ARTIFACT }} s3://qgroundcontrol/builds/${{ github.ref_name }}/${{ matrix.ARTIFACT }} --region us-west-2 --acl public-read
- name: Upload tagged stable build to S3 latest Bucket - name: Upload tagged stable build to S3 latest Bucket
if: github.event_name == 'push' && github.ref_type == 'tag' if: github.event_name == 'push' && github.ref_type == 'tag'

7
.github/workflows/linux_release.yml

@ -103,18 +103,13 @@ jobs:
name: ${{ env.ARTIFACT }} name: ${{ env.ARTIFACT }}
path: ${{ runner.temp }}/shadow_build_dir/package/${{ env.ARTIFACT }} path: ${{ runner.temp }}/shadow_build_dir/package/${{ env.ARTIFACT }}
# This will set GIT_BRANCH_NAME environment variable
- name: Git branch name
id: git-branch-name
uses: EthanSK/git-branch-name-action@v1
- name: Upload build to S3 Bucket - name: Upload build to S3 Bucket
if: github.event_name == 'push' if: github.event_name == 'push'
working-directory: ${{ runner.temp }}/shadow_build_dir/package working-directory: ${{ runner.temp }}/shadow_build_dir/package
run: | run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws s3 cp ${ARTIFACT} s3://qgroundcontrol/builds/${GIT_BRANCH_NAME}/${ARTIFACT} --region us-west-2 --acl public-read aws s3 cp ${ARTIFACT} s3://qgroundcontrol/builds/${{ github.ref_name }}/${ARTIFACT} --region us-west-2 --acl public-read
- name: Upload tagged stable build to S3 latest Bucket - name: Upload tagged stable build to S3 latest Bucket
if: github.event_name == 'push' && github.ref_type == 'tag' if: github.event_name == 'push' && github.ref_type == 'tag'

7
.github/workflows/macos_release.yml

@ -99,18 +99,13 @@ jobs:
name: ${{ env.ARTIFACT }} name: ${{ env.ARTIFACT }}
path: ${{ runner.temp }}/shadow_build_dir/package/${{ env.ARTIFACT }} path: ${{ runner.temp }}/shadow_build_dir/package/${{ env.ARTIFACT }}
# This will set GIT_BRANCH_NAME environment variable
- name: Git branch name
id: git-branch-name
uses: EthanSK/git-branch-name-action@v1
- name: Upload build to S3 Bucket - name: Upload build to S3 Bucket
if: github.event_name == 'push' if: github.event_name == 'push'
working-directory: ${{ runner.temp }}/shadow_build_dir/package working-directory: ${{ runner.temp }}/shadow_build_dir/package
run: | run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws s3 cp ${ARTIFACT} s3://qgroundcontrol/builds/${GIT_BRANCH_NAME}/${ARTIFACT} --region us-west-2 --acl public-read aws s3 cp ${ARTIFACT} s3://qgroundcontrol/builds/${{ github.ref_name }}/${ARTIFACT} --region us-west-2 --acl public-read
- name: Upload tagged stable build to S3 latest Bucket - name: Upload tagged stable build to S3 latest Bucket
if: github.event_name == 'push' && github.ref_type == 'tag' if: github.event_name == 'push' && github.ref_type == 'tag'

7
.github/workflows/windows_release.yml

@ -101,18 +101,13 @@ jobs:
name: qgroundcontrol.pdb name: qgroundcontrol.pdb
path: ${{ runner.temp }}\shadow_build_dir\staging\qgroundcontrol.pdb path: ${{ runner.temp }}\shadow_build_dir\staging\qgroundcontrol.pdb
# This will set GIT_BRANCH_NAME environment variable
- name: Git branch name
id: git-branch-name
uses: EthanSK/git-branch-name-action@v1
- name: Upload build to S3 Bucket - name: Upload build to S3 Bucket
if: github.event_name == 'push' if: github.event_name == 'push'
working-directory: ${{ runner.temp }}\shadow_build_dir\staging working-directory: ${{ runner.temp }}\shadow_build_dir\staging
run: | run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws s3 cp ${{ env.ARTIFACT }} s3://qgroundcontrol/builds/${{ env.GIT_BRANCH_NAME }}/${{ env.ARTIFACT }} --region us-west-2 --acl public-read aws s3 cp ${{ env.ARTIFACT }} s3://qgroundcontrol/builds/${{ github.ref_name }}/${{ env.ARTIFACT }} --region us-west-2 --acl public-read
- name: Upload tagged stable build to S3 latest Bucket - name: Upload tagged stable build to S3 latest Bucket
if: github.event_name == 'push' && github.ref_type == 'tag' if: github.event_name == 'push' && github.ref_type == 'tag'

Loading…
Cancel
Save