Skip to content

Commit

Permalink
Rename "master" to "main"
Browse files Browse the repository at this point in the history
Continue to accept "master" for manual releases, and add "master"
suffixed tags for main branch images, for backwards compatibility.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
  • Loading branch information
jefferyto authored and aparcar committed Jun 29, 2023
1 parent b3af84b commit ecd0a15
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
workflow_dispatch:
inputs:
ref:
description: "Tag or branch to deploy (empty for master)"
default: "master"
description: "Tag or branch to deploy (empty for main)"
default: "main"
required: false
target:
description: "Single target to build (empty for all)"
Expand Down Expand Up @@ -48,11 +48,11 @@ jobs:
- name: Set relase manually
if: github.event.inputs.ref != ''
run: |
export REF=${{ github.event.inputs.ref }}
export REF=${{ github.event.inputs.ref == 'master' && 'main' || github.event.inputs.ref }}
echo "REF=$REF" >> "$GITHUB_ENV"
case $REF in
master)
main)
VERSION=SNAPSHOT
echo "VERSION_PATH=snapshots" >> "$GITHUB_ENV"
;;
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
echo -e "\n---- sdks ----\n"
echo "sdks=$JSON" >> "$GITHUB_OUTPUT"
echo "ref=${REF:-master}" >> "$GITHUB_OUTPUT"
echo "ref=${REF:-main}" >> "$GITHUB_OUTPUT"
echo "version=${VERSION:-SNAPSHOT}" >> "$GITHUB_OUTPUT"
echo "version_path=${VERSION_PATH:-snapshots}" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -191,6 +191,7 @@ jobs:
tags: |
${{ matrix.target }}-${{ needs.generate_matrix.outputs.ref }}
${{ matrix.target }}-${{ needs.generate_matrix.outputs.version }}
${{ matrix.target }}-master,enable=${{ needs.generate_matrix.outputs.ref == 'main' }}
latest,enable=${{ needs.generate_matrix.outputs.version == 'SNAPSHOT' && matrix.target == 'x86/64'}}
- name: Build and push
Expand Down Expand Up @@ -262,13 +263,28 @@ jobs:
suffix=-${{ needs.generate_matrix.outputs.version }}
tags: ${{ matrix.tags }}

- name: Docker meta (master)
if: needs.generate_matrix.outputs.ref == 'main'
id: meta_master
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/openwrt/sdk
docker.io/openwrt/sdk
quay.io/openwrt/sdk
flavor: |
latest=false
suffix=-master
tags: ${{ matrix.tags }}

- name: Build and push
uses: docker/build-push-action@v3
with:
push: ${{ github.event_name != 'pull_request' }}
tags: |
${{ steps.meta_ref.outputs.tags }}
${{ steps.meta_version.outputs.tags }}
${{ steps.meta_master.outputs.tags }}
build-args: |
DOWNLOAD_FILE=sdk-.*.Linux-x86_64.tar.xz
VERSION_PATH=${{ needs.generate_matrix.outputs.version_path }}
Expand Down Expand Up @@ -327,8 +343,10 @@ jobs:
tags: |
${{ matrix.target }}-${{ needs.generate_matrix.outputs.ref }}
${{ matrix.target }}-${{ needs.generate_matrix.outputs.version }}
${{ matrix.target }}-master,enable=${{ needs.generate_matrix.outputs.ref == 'main' }}
${{ matrix.arch }}-${{ needs.generate_matrix.outputs.ref }}
${{ matrix.arch }}-${{ needs.generate_matrix.outputs.version }}
${{ matrix.arch }}-master,enable=${{ needs.generate_matrix.outputs.ref == 'main' }}
latest,enable=${{ needs.generate_matrix.outputs.version == 'SNAPSHOT' && matrix.target == 'x86/64'}}
- name: Generate build args
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ All currently available SDKs via tags in the following format:
* `<target>-<subtarget>[-<branch|tag|version>]`

The `branch|tag|version` can be something like `openwrt-22.03` (branch),
`v22.03.4` (tag) or `21.02.3` (version). To use daily builds use either `master`
`v22.03.4` (tag) or `21.02.3` (version). To use daily builds use either `main`
or `SNAPSHOT`.

## `imagebuilder`
Expand Down Expand Up @@ -84,7 +84,7 @@ All currently available ImageBuilders via tags in the following format:
* `<arch>[-<branch|tag|version>]`

The `branch|tag|version` can be something like `openwrt-22.03` (branch),
`v22.03.4` (tag) or `21.02.3` (version). To use daily builds use either `master`
`v22.03.4` (tag) or `21.02.3` (version). To use daily builds use either `main`
or `SNAPSHOT`.

## `rootfs` (experimental)
Expand Down

0 comments on commit ecd0a15

Please sign in to comment.