Skip to content

Commit

Permalink
Merge pull request #4015 from deitch/pkg-tag-workflow
Browse files Browse the repository at this point in the history
ensure package release flow is picked up
  • Loading branch information
deitch committed Mar 11, 2024
2 parents 55963aa + 15730ea commit 719ae00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
19 changes: 6 additions & 13 deletions .github/workflows/package_release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
name: Release a tag

on:
workflow_run:
workflows: [LinuxKit CI]
types: [completed]
branches: [master, main]
create:

jobs:
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/pkg-v')
name: Release packages
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/pkg-v')
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.21
Expand All @@ -21,23 +18,19 @@ jobs:
uses: actions/checkout@v3
- name: Ensure bin/ directory
run: mkdir -p bin
- name: Download linuxkit
- name: Install linuxkit
run:
go build -o bin/linuxkit ./src/cmd/linuxkit
sudo mv bin/linuxkit /usr/local/bin/
- name: Restore Package Cache
uses: actions/cache@v3
with:
path: ~/.linuxkit/cache/
key: ${{ runner.os }}-linuxkit-${{ github.sha }}
restore-keys: |
${{ runner.os }}-linuxkit-
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Publish Packages as Release
# this should not build anything, as they all should be built already
# however, it can fail if we push the tag before the merge-to-master build is complete, since that may publish
# so *always* wait for any merge-to-master to complete before publishing pkg-v* tags
run: |
RELEASE_TAG=${GITHUB_REF#refs/tags/pkg-}
echo "RELEASE_TAG=${RELEASE_TAG}"
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ name: Release a tag

on:
create:
tags:
- v*

jobs:
build:
name: Build all targets
runs-on: macos-latest
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.19
Expand Down

0 comments on commit 719ae00

Please sign in to comment.