Skip to content

Commit 4e2afb9

Browse files
committed
structure update and gh action tweak
1 parent 53ad54b commit 4e2afb9

File tree

10 files changed

+592
-398
lines changed

10 files changed

+592
-398
lines changed

.github/workflows/build-binaries.yml

Lines changed: 0 additions & 103 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- '**' # Matches all branches for now
7+
paths:
8+
- 'CHANGELOG.md'
9+
10+
permissions: {}
11+
12+
env:
13+
CARGO_TERM_COLOR: always
14+
RELEASE_BIN: mira-oxide
15+
REGISTRY: ghcr.io
16+
17+
jobs:
18+
create-release:
19+
name: Create New Release
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: write
23+
outputs:
24+
upload_url: ${{ steps.create_release.outputs.upload_url }}
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Extract Changelog
29+
id: extract_changelog
30+
shell: bash
31+
run: perl .github/scripts/last_release_notes.pl > $RUNNER_TEMP/release_notes.md
32+
33+
- name: Create Release
34+
id: create_release
35+
shell: bash
36+
run: |
37+
[[ "${{ github.ref_name }}" == "test" ]] && latest="--latest=false" || latest=
38+
39+
gh release create "${{ github.ref_name }}" \
40+
--title "${RELEASE_BIN} ${{ github.ref_name }}" \
41+
--notes-file "$RUNNER_TEMP/release_notes.md" \
42+
$latest
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
46+
build-release-image-and-linux-artifacts:
47+
name: Build Linux Artifacts and Images
48+
needs: [create-release]
49+
strategy:
50+
matrix:
51+
include:
52+
- arch: x86_64
53+
runner: ubuntu-latest
54+
- arch: aarch64
55+
runner: ubuntu-24.04-arm
56+
runs-on: ${{ matrix.runner }}
57+
permissions:
58+
contents: write
59+
packages: write
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Log in to the Container registry
64+
uses: docker/login-action@v3
65+
with:
66+
registry: ${{ env.REGISTRY }}
67+
username: ${{ github.actor }}
68+
password: ${{ secrets.GITHUB_TOKEN }}
69+
70+
- name: Extract metadata for Docker
71+
id: meta
72+
uses: docker/metadata-action@v5
73+
with:
74+
images: ${{ env.REGISTRY }}/${{ github.repository }}
75+
tags: |
76+
type=raw,value=latest-${{ matrix.arch }}
77+
78+
- name: Debug Git ref
79+
run: |
80+
echo "GITHUB_REF: $GITHUB_REF"
81+
echo "GITHUB_REF_NAME: $GITHUB_REF_NAME"
82+
echo "GITHUB_SHA: $GITHUB_SHA"
83+
echo "GITHUB_REPOSITORY: $GITHUB_REPOSITORY"
84+
85+
- name: Build and push Docker image
86+
uses: docker/build-push-action@v6
87+
with:
88+
file: Dockerfile
89+
context: .
90+
push: true
91+
tags: ${{ steps.meta.outputs.tags }}
92+
93+
- name: Prepare Linux Binary
94+
shell: bash
95+
run: |
96+
IMAGE_TAG=$(echo "${{ steps.meta.outputs.tags }}" | grep -- '-${{ matrix.arch }}$' | head -n 1)
97+
docker create --name temp-container $IMAGE_TAG \
98+
&& docker cp temp-container:/app/${RELEASE_BIN} ./${RELEASE_BIN} \
99+
&& docker rm temp-container \
100+
&& tar -czf ${RELEASE_BIN}-linux-${{ matrix.arch }}-${{ github.ref_name }}.tar.gz ${RELEASE_BIN}
101+
102+
- name: Upload Linux Release Asset
103+
shell: bash
104+
run: |
105+
gh release upload "${{ github.ref_name }}" ${RELEASE_BIN}-linux-${{ matrix.arch }}-${{ github.ref_name }}.tar.gz
106+
env:
107+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108+
109+
create-image-manifest:
110+
name: Create Image Manifest
111+
needs: build-release-image-and-linux-artifacts
112+
runs-on: ubuntu-latest
113+
permissions:
114+
packages: write
115+
contents: read
116+
steps:
117+
- name: Log in to the Container registry
118+
uses: docker/login-action@v3
119+
with:
120+
registry: ${{ env.REGISTRY }}
121+
username: ${{ github.actor }}
122+
password: ${{ secrets.GITHUB_TOKEN }}
123+
124+
- name: Create and push manifests
125+
shell: bash
126+
run: |
127+
REPO=$(echo "${{ env.REGISTRY }}/${{ github.repository }}" | tr '[A-Z]' '[a-z]')
128+
VERSION=${REPO}:${{ github.ref_name }}
129+
LATEST=${REPO}:latest
130+
131+
docker manifest create $VERSION --amend ${LATEST}-x86_64 --amend ${LATEST}-aarch64 \
132+
&& docker manifest push $VERSION
133+
134+
docker manifest create $LATEST --amend ${LATEST}-x86_64 --amend ${LATEST}-aarch64 \
135+
&& docker manifest push $LATEST
136+
137+
build-mac-artifacts:
138+
name: Build Mac Artifacts
139+
needs: create-release
140+
runs-on: macos-latest
141+
142+
permissions:
143+
contents: write
144+
145+
steps:
146+
- uses: actions/checkout@v4
147+
148+
- name: Install latest nightly Rust
149+
run: |
150+
rustup update nightly
151+
rustup default nightly
152+
rustup target add aarch64-apple-darwin x86_64-apple-darwin
153+
154+
- name: Build
155+
run: |
156+
cargo build --release --target aarch64-apple-darwin --target x86_64-apple-darwin
157+
158+
- name: Package Binary
159+
shell: bash
160+
run: |
161+
lipo -create -output ${{ env.RELEASE_BIN }} \
162+
target/aarch64-apple-darwin/release/${{ env.RELEASE_BIN }} \
163+
target/x86_64-apple-darwin/release/${{ env.RELEASE_BIN }}
164+
tar -czf ${{ env.RELEASE_BIN }}-apple-universal-${{ github.ref_name }}.tar.gz ${{ env.RELEASE_BIN }}
165+
166+
- name: Upload Release Asset
167+
shell: bash
168+
run: |
169+
gh release upload "${{ github.ref_name }}" ${{ env.RELEASE_BIN }}-apple-universal-${{ github.ref_name }}.*
170+
env:
171+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# cdcgov/mira-oxide: Changelog
2+
3+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
4+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5+
6+
## [0.0.0] - 2025-09-19
7+
### THIS IS A TEST
8+
9+
10+
## [1.1.2] - 2025-09-19
11+
12+
- [Amanda Sullivan](https://github.com/mandysulli)
13+
14+
### `Added`
15+
16+
- [PR #44](https://github.com/CDCgov/mira-oxide/pull/44) - Added filtering to a single subtype for the variants_of_interest outputs if the virus flu (as "INFLUENZA") is passed to the program.
17+
- [PR #46](https://github.com/CDCgov/mira-oxide/pull/46) - Added filtering to a single subtype for the positions_of_interest outputs if the virus flu (as "INFLUENZA") is passed to the program.
18+
19+
## [1.1.1] - 2025-09-11
20+
21+
- [Sam Wiley](https://github.com/samcwiley)
22+
23+
### `Fixed`
24+
25+
- [PR #38](https://github.com/CDCgov/mira-oxide/pull/38) - Fixed issue with `find_chemistry.rs` not being able to handle compressed files
26+
27+
### `Added`
28+
29+
- [PR #38](https://github.com/CDCgov/mira-oxide/pull/38) - Adds `utils/read_fastq.rs` with functionality for handling gzipped fastq files
30+
31+
<!-- Versions -->
32+
33+
[1.1.1]: https://github.com/CDCgov/mira-oxide/compare/f824940...v1.1.1

0 commit comments

Comments
 (0)