mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
Auto-upload Linux build
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
name: Docker Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [released]
|
||||
|
||||
jobs:
|
||||
trigger-build:
|
||||
uses: ./.github/workflows/docker.yml
|
||||
with:
|
||||
tag: ${{ github.event.release.tag_name }}
|
||||
secrets: inherit
|
||||
upload-docker:
|
||||
needs: trigger-build
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Upload binary to existing release
|
||||
run: make zip_linux_release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,28 +1,30 @@
|
||||
name: docker
|
||||
name: Docker Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- '*'
|
||||
workflow_call:
|
||||
inputs:
|
||||
tag:
|
||||
description: 'Docker tag'
|
||||
required: true
|
||||
type: string
|
||||
default: 'latest'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-20.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Extract DOCKER_TAG using tag name
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
run: |
|
||||
echo "DOCKER_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
|
||||
- name: Use default DOCKER_TAG
|
||||
if: startsWith(github.ref, 'refs/tags/') != true
|
||||
run: |
|
||||
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
|
||||
- name: Set Docker tag
|
||||
if: github.event_name == 'workflow_call'
|
||||
run: echo "DOCKER_TAG=${{ inputs.tag }}" >> $GITHUB_ENV
|
||||
- name: Use default Docker tag
|
||||
if: github.event_name == 'push'
|
||||
run: echo "DOCKER_TAG=latest" >> $GITHUB_ENV
|
||||
- name: Set lowercase repository name
|
||||
run: |
|
||||
echo "REPOSITORY_LC=${REPOSITORY,,}" >>${GITHUB_ENV}
|
||||
run: echo "REPOSITORY_LC=${REPOSITORY,,}" >> $GITHUB_ENV
|
||||
env:
|
||||
REPOSITORY: '${{ github.repository }}'
|
||||
- name: Set up Docker Buildx
|
||||
@@ -31,7 +33,7 @@ jobs:
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
registry: ghcr.io
|
||||
- uses: docker/build-push-action@v6
|
||||
with:
|
||||
|
||||
@@ -10,5 +10,4 @@ For SwiftLint contributors, follow these steps to cut a release:
|
||||
1. Make sure you have the latest stable Xcode version installed and
|
||||
`xcode-select`ed
|
||||
1. Release new version: `make release "0.2.0: Tumble Dry"`
|
||||
1. Wait for the Docker CI job to finish then run: `make zip_linux_release`
|
||||
1. Celebrate. :tada:
|
||||
|
||||
Reference in New Issue
Block a user