Skip to content

Commit

Permalink
update to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
danisla committed Sep 5, 2023
1 parent 4d2172c commit f69eccb
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_and_publish_all_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

name: ${{ matrix.name }}${{ matrix.version_suffix }} image build & publish
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build & publish ${{ matrix.name }} image
uses: ./.github/actions/build_and_publish_image
Expand Down Expand Up @@ -80,7 +80,7 @@ jobs:

name: ${{ matrix.name }}${{ matrix.version_suffix }} image build & publish
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build & publish ${{ matrix.name }} image
uses: ./.github/actions/build_and_publish_image
Expand Down
26 changes: 16 additions & 10 deletions .github/workflows/build_and_publish_changed_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
push:
branches:
- master
pull_request:
branches: master
paths-ignore:
- README.md
- .devconttainer/**
- .vscode/**
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -49,21 +55,21 @@ jobs:
build_args: PACKAGE_VERSION=0.0.0.dev0
source_directory: .
source_files_for_diff: |
^src
^Dockerfile$
src/**
Dockerfile
pyproject.toml
setup.cfg
.github/workflows/build_and_publish_changed_images.yaml
name: ${{ matrix.name }}${{ matrix.version_suffix }} image build & publish
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2 # This is for changed-files.

- name: Check for changes to image source
id: check
uses: tj-actions/changed-files@v1.1.2
uses: tj-actions/changed-files@v38
with:
files: ${{ matrix.source_files_for_diff }}

Expand Down Expand Up @@ -91,8 +97,8 @@ jobs:
dockerfile: Dockerfile.example
source_directory: .
source_files_for_diff: |
addons
src
addons/**
src/**
Dockerfile
Dockerfile.example
pyproject.toml
Expand All @@ -105,8 +111,8 @@ jobs:
dockerfile: Dockerfile.example
source_directory: .
source_files_for_diff: |
addons
src
addons/**
src/**
Dockerfile
Dockerfile.example
pyproject.toml
Expand All @@ -115,13 +121,13 @@ jobs:
name: ${{ matrix.name }}${{ matrix.version_suffix }} image build & publish
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 2 # This is for changed-files.

- id: check
name: Check for changes to ${{ matrix.name }} image source
uses: tj-actions/changed-files@v1.1.2
uses: tj-actions/changed-files@v38
with:
files: ${{ matrix.source_files_for_diff }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/devcontainer_feature_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
pull-requests: write
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: "Publish Features"
uses: devcontainers/action@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/devcontainer_feature_validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: "Validate devcontainer-feature.json files"
uses: devcontainers/action@v1
Expand Down
73 changes: 34 additions & 39 deletions .github/workflows/publish_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
name: Publish release

on:
push:
tags:
- "v*"
release:
types: [created, edited]
workflow_dispatch:

jobs:
Expand All @@ -19,7 +18,14 @@ jobs:
- id: get
env:
RELEASE_VERSION: ${{ github.ref_name }}
run: echo semver=${RELEASE_VERSION/v/} >> $GITHUB_OUTPUT
run: |
# If ref name does not match semver, default to 0.0.0.
# This happens when running from a branch name like master.
if [[ ${RELEASE_VERSION} =~ ^v[0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo semver=${RELEASE_VERSION/v/} >> $GITHUB_OUTPUT
else
echo semver=0.0.0 >> $GITHUB_OUTPUT
fi
# Note: When modifying this job, copy modifications to all other workflows' image jobs.
all_component_images:
Expand Down Expand Up @@ -56,7 +62,7 @@ jobs:

name: ${{ matrix.name }}${{ matrix.version_suffix }} image build & publish
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build & publish ${{ matrix.name }} image
uses: ./.github/actions/build_and_publish_image
Expand Down Expand Up @@ -92,7 +98,7 @@ jobs:

name: ${{ matrix.name }}${{ matrix.version_suffix }} image build & publish
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Build & publish ${{ matrix.name }} image
uses: ./.github/actions/build_and_publish_image
Expand Down Expand Up @@ -206,8 +212,9 @@ jobs:
key: ${{ matrix.cache_key }}
path: ${{ matrix.target_directory }}/${{ matrix.target_name }}

create_release:
upload_assets:
runs-on: ubuntu-latest
if: github.event_name == 'release'
needs:
- all_component_images
- all_example_images
Expand Down Expand Up @@ -237,52 +244,40 @@ jobs:
key: ${{ needs.all_assets.outputs.web_cache_key }}
path: ${{ needs.all_assets.outputs.web_path }}

- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
release_name: Release ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}

- name: Ubuntu 20.04 upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: svenstaro/upload-release-action@v2
with:
asset_content_type: ${{ needs.all_assets.outputs.gst20_mimetype }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ${{ needs.all_assets.outputs.gst20_path }}
asset_name: ${{ needs.all_assets.outputs.gst20_name }}
asset_path: ${{ needs.all_assets.outputs.gst20_path }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
overwrite: true

- name: Ubuntu 22.04 upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: svenstaro/upload-release-action@v2
with:
asset_content_type: ${{ needs.all_assets.outputs.gst22_mimetype }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ${{ needs.all_assets.outputs.gst22_path }}
asset_name: ${{ needs.all_assets.outputs.gst22_name }}
asset_path: ${{ needs.all_assets.outputs.gst22_path }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
overwrite: true

- name: Python upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: svenstaro/upload-release-action@v2
with:
asset_content_type: ${{ needs.all_assets.outputs.py_mimetype }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ${{ needs.all_assets.outputs.py_path }}
asset_name: ${{ needs.all_assets.outputs.py_name }}
asset_path: ${{ needs.all_assets.outputs.py_path }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
overwrite: true

- name: Web upload
uses: actions/upload-release-asset@v1
uses: svenstaro/upload-release-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
asset_content_type: ${{ needs.all_assets.outputs.web_mimetype }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
file: ${{ needs.all_assets.outputs.web_path }}
asset_name: ${{ needs.all_assets.outputs.web_name }}
asset_path: ${{ needs.all_assets.outputs.web_path }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
overwrite: true

0 comments on commit f69eccb

Please sign in to comment.